+2 votes

What I Know:
It is possible to load a collision mesh with open-collada (flags: -col / -colonly)

My Question(s):
Is it possible to load a OBJ or MSH file as a collision shape?
Can not find this option in the editor.
Is it possible to load it by GD-Script?

in Engine by (33 points)

I'm also interested in how collision meshes work in Godot.
I opened the "3d/sat_test" demo but apparently collision meshes are already included in the scene, no particular file for them but "shapes.dae". There is no doc about this yet on the website unfortunately...

1 Answer

+6 votes
Best answer

Is it possible to load a OBJ or MSH file as a collision shape?

No, it isn't possible (import it as a coll. shape). You have to import your object as a 3D Scene. OBJ files use 3D Mesh option.

Can not find this option in the editor.

But you can convert it manually! Import your OBJ model/models as a 3D Mesh, create MeshInstance node, load imported .msh file, click on Mesh button (in the bar under tabs next to the View button) and choose Create Trimesh/Convex Static Body. Done.

Is it possible to load it by GD-Script?

I don't think so.

I'm also interested in how collision meshes work in Godot.

Node CollisionShape needs a Shape, which is a Resource data type. Resources can be saved to files or built-in (packed in the scene). And they are documented right here. http://docs.godotengine.org/en/latest/tutorials/step_by_step/resources.html

by (822 points)
selected by

Thank you for your answer!
That is what i have searched for.
The menu-botton is hidden in the 3D-Viewport header tabs.
I have not seen it, of course it´s only showing up when the
Mesh-Instance is selected in the Scene-Tab.
The 3D-Viewport is not a place where anybody would search intentonaly.
However, it is good to know where i can find it.

But how to I import somethin as a col shape?

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 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 webmaster@godotengine.org with your username.