Wouter Vandenputte
Wouter Vandenputte

Reputation: 2103

Godot Mesh Create Collision shape: Mesh is empty

I have a very basic mesh imported for this example. I just resized the default blender cube to a more plane-like structure and exported it into glb and then imported it in Godot.

In Godot, I created a Rigidbody3D and then added that mesh as its child enter image description here

So far so good, I now want to give that floor a collisionShape. Yes, I coulld literally add a collision shape and resize it along to the mesh of the floor, but this is just an substitute example for a more complicated mesh.

To do this, all tutorials/documentation say to just select the 'Mesh' button on the top that appears when the mesh is also selected in the editor and press the 'Create Collision Shape' button.

But when I do that, instead of getting that collisionshape, all I get is this error "Mesh is empty!" that no one else seems to have. I'm quite new to Godot but I do have experience with Unity also with collisions and meshes and Blender. Since we are talking about a simple convex collision shape, along the lines of the mesh, why is this being so difficult...

enter image description here enter image description here

EDIT: I added a reproducibale minimal example here

Upvotes: 0

Views: 181

Answers (1)

unlut
unlut

Reputation: 3775

Here steps I used to add collision shape to your mesh.

1- Add your glb as a child node to some scene
2- In scene tab, find the newly added node and press "Open in Editor" button.
3- In the floor scene, select Mesh node and add collision shape as you show in the question. This will create a CollisionShape3D node.
4- In the floor scene, add a StaticBody3D node and make the previously created CollisionShape3D node a child of this node.
5- Save this newly modified scene by Scene-> "Save Scene As".

Now you can use this newly created scene in your main scene.

Upvotes: 1

Related Questions