Troubl using a scene as mesh

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

Hey, guys. I’m trying to use a scene as a mesh from code for the Meshintance of a KB when running the game but nothing appears.
The funny part is when using CubeMesh the Cube appears on the screen.
Any ideas?

func _ready():

sprite =
var mesh = load("res://assets/asset_test.tscn").instance()
# var mesh =  THIS WORKS

var material =;
material.albedo_color =

sprite.set_surface_material(0,material) = "Sprite"
:bust_in_silhouette: Reply From: Wakatta

Simply put Mesh and PackedScene Resource are not compatible

External mesh types are of file extensions .obj, .tres, .mesh, .res

And compatible types are of CubeMesh, ArrayMesh, PrismMesh, QuadMesh, CylinderMesh, SphereMesh, CapsuleMesh, PointMesh, PlaneMesh

Basically if it doesn’t end with Mesh it won’t mesh with MeshInstance.mesh

The only way to achieve what you want is to dabble with ViewportTextures

Thanks! Now I know what I was doing wrong :smiley:

scolllly93 | 2021-04-02 15:18