Access or get Node mesh

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By agus
:warning: Old Version Published before Godot 3 was released.

Hi,
First at all, let me tell you how amazed and happy i am about this engine.
Second, i just get started and I can not access the node mesh instance. What i really want to get is the AABB of the mesh.
So:

  • I know that MeshInstance comes from node, but i am unable to cast it from Node → MeshInstance. If this kind of cast is posible, how we can do this?

  • Is there a Node method that retrieve me the mesh instance or AABB?

  • I do not want to extend from MeshInstance in my script. i need to be extended by Node.

Thank you very much.

:bust_in_silhouette: Reply From: eaglecat

here’s easiest way.

add child MeshInstance to your node. and your code will be like this.

var aabb = get_node("myMeshInstance").get_aabb()

Yes thats it! Thank you very much!

agus | 2016-04-19 22:42

then, select my answer please ^-^

eaglecat | 2016-04-20 04:27