Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Asset Forge

Create your own 3D models and 2D sprites! · By Kenney

Enable collision import in Godot on model export.

A topic by Maindric created Jun 07, 2021 Views: 1,552 Replies: 5
Viewing posts 1 to 4
(1 edit)

This may be a Godot-specific request, but here goes:

For a model to have static collision, it would be nice if there was a checkbox on export for Godot to export collision data as well.  This should be fairly simple to do, on export the meshes will need to append the string "-col" and Godot will automatically add colliders to them upon import.

The current work flow for me is to export twice, once as normal, another as merged (which is bugged to not be rotated the same as unmerged).  The merged, I can then muck around and force a collider.  This solution is less than ideal.  Having a checkbox would simplify the process.

(1 edit)

From some testing, I found we can do this already--kind of.

I can go in and click each object manually and add "-col" to the end of the object name.  Once exported, Godot recognizes this and generates a collision for that particular object.  However, for models with dozens, if not hundreds, of objects this can be tedious.  I do like the large range of control as I do not want everything to have collisions (grass for example and for performance).  Having some mechanism, such as the Layers - Feature requests - itch.io request to see all objects in a list would make this much easier.  Having a checkbox that I can click with many objects selected to append "-col" to their names would also make this much easier.


I personally feel like this feature would be a better fit for Godot to add, a checkbox when importing models to create collision data. Unity has a similar feature to this.

(2 edits)

Correct, this is a feature within Godot. However, how it handles this is based on the names of the meshes on import.

Here are the docs: https://docs.godotengine.org/en/stable/getting_started/workflow/assets/importing_scenes.html#import-hints

Right now, there is no simple way to add these names to the objects. For simple models built in Asset Forge, this is not much of an issue. However, having some flexibility on the names of the meshes on export would make this significantly easier.

For example, here is a scene that I made in Asset Forge (as imported by Godot)

The second file is the collision mesh I made for the level. Simpler geometry, better performance, etc. As it is now, I have to import the mesh, made a new scene, and set the collision manually (Not too much an issue, but it is not automated.) If I could just have -colonly at the end of the mesh name on export, that would save that step.

If we could get more specific mesh naming controls, that would solve the issue too (and possibly better if we can merge groups on export and name that group). It’s just fairly tedious as it is now managing multiple files and multiple scenes to get it in that requires redoing it all when a modification is made that a little bit of text on export would solve.

There is a quick way to add a collision map that matches your 3D models.

- Import your object as obj.

- Select it and in viewport top bar next to Transform and View click Mesh.

- Here you can select a few variations depending on what you want with performance. Despite that if you choose Trimesh Static Body you will have a collision shape that matches your object.


Though it isn't as easy as a check box, it accomplishes the same thing.

So glad I found this tip, thanks!