Work in progress

Godot documentation is being updated to reflect the latest changes in version 4.0. Some documentation pages may still state outdated information. This banner will tell you if you're reading one of such pages.

The contents of this page are up to date. If you can still find outdated information, please open an issue.

MeshInstance2D

Inherits: Node2D < CanvasItem < Node < Object

Node used for displaying a Mesh in 2D.

Description

Node used for displaying a Mesh in 2D. A MeshInstance2D can be automatically created from an existing Sprite2D via a tool in the editor toolbar. Select the Sprite2D node, then choose Sprite2D > Convert to MeshInstance2D at the top of the 2D editor viewport.

Tutorials

Properties

Mesh

mesh

Texture2D

texture


Signals

texture_changed ( )

Emitted when the texture is changed.


Property Descriptions

Mesh mesh

  • void set_mesh ( Mesh value )

  • Mesh get_mesh ( )

The Mesh that will be drawn by the MeshInstance2D.


Texture2D texture

The Texture2D that will be used if using the default CanvasItemMaterial. Can be accessed as TEXTURE in CanvasItem shader.