How to make a collision shape fit the shape of my mesh

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

Hello, I have a quite complex mesh and I would like to add a collision shape to fit it without having to do it manually. Is there a way to do this?

:bust_in_silhouette: Reply From: Ertain

Have you tried using a feature in the editor to make the shape? From the documentation:

You can generate one or several convex collision shapes from the editor by selecting a MeshInstance and using the Mesh menu at the top of the 3D viewport.

enter image description here

Wakatta | 2021-01-17 23:55

Is there a way to do it in code?

SteveSmith | 2022-12-11 11:02

Maybe you’re looking for the create_convex_collision() function?

Ertain | 2022-12-11 16:50