Inherits: GeometryInstance < VisualInstance < Spatial < Node < Object

Category: Core

Brief Description

Node that instances meshes into a scenario.

Member Functions

void create_convex_collision ( )
void create_trimesh_collision ( )
AABB get_aabb ( ) const
Mesh get_mesh ( ) const
NodePath get_skeleton_path ( )
void set_mesh ( Mesh mesh )
void set_skeleton_path ( NodePath skeleton_path )


MeshInstance is a Node that takes a Mesh resource and adds it to the current scenario by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a single Mesh in many places. This allows to reuse geometry and save on resources. When a Mesh has to be instanced more than thousands of times at close proximity, consider using a MultiMesh in a MultiMeshInstance instead.

Member Function Description

  • void create_convex_collision ( )
  • void create_trimesh_collision ( )

This helper creates a StaticBody child Node using the mesh geometry as collision. It’s mainly used for testing.

  • AABB get_aabb ( ) const

Return the AABB of the mesh, in local coordinates.

  • Mesh get_mesh ( ) const

Return the current Mesh resource for the instance.

  • void set_mesh ( Mesh mesh )

Set the Mesh resource for the instance.

  • void set_skeleton_path ( NodePath skeleton_path )