How do I set a mesh instance's mesh from a resource filepath?

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


I have a mesh bundled as a .tres resource in a folder in my project and I have the filepath to it.

My question is : how do I use this path to set the mesh of a MeshInstance in code? More specifically, how do I get a mesh variable from the path? Thank you.

:bust_in_silhouette: Reply From: klaas

you can just …

 mesh_instance.mesh = load("res://path_to_mesh.tres")

It worked, thank you!

Unityfugee | 2021-08-10 23:08