Generate collision shape of mesh from code

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

Hi,

in the mesh menu of the editor there are some options (e.g. “create Trimesh static body”) to create a collision shape based on a MeshInstance.

Can something similar be achieved using gdscript at runtime?

Thanks in advance,
Tobi

:bust_in_silhouette: Reply From: Oen44

Using create_convex_collision or create_trimesh_collision

1 Like