+2 votes

I have a MeshInstance node with a mesh assigned. How do I create a collider from this mesh? The MeshInstance in question has a mesh that serves as terrain, so I want, for example, a ball to be able to roll down the slopes on the terrain.

in Engine by (111 points)

2 Answers

+3 votes
Best answer

I figured out how to do it in code. C# code:


GDScript code should look like this:


Thanks to Zylann too for showing how to do it via the editor.

by (111 points)
+7 votes

Select the MeshInstance, and look at the menu bar on top of the 3D viewport. You will see a Mesh menu. Click on it to see several options to generate the collider, for example you can try Mesh -> Create Trimesh StaticBody.

by (29,042 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.