How to get the dimensions of a CubMesh instance in GDScript?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rogeriodec

How can I get the dimensions of a 3D Cube Mesh (height, width, depth) within GDScript?

Ex: My cube has 10 x 0.25 x 1.5

How can I get these values?

:bust_in_silhouette: Reply From: Calinou

You can retrieve its size (and set it if needed) using $MeshInstance.mesh.size (if the node is called MeshInstance). Other primitive meshes’ properties may have different names, check the inspector for possible values.