godot: GridMap does not convert collision data and it's not possible to define this data manually

Operating system or device, Godot version, GPU Model and driver (if graphics related): master branch - b368ce1719746c69828688b9bf88396dd10dfe26 Windows 10 Compiler: MSVC x64 Debug

Issue description: GridMap does not import the collisions of the tiles being converted in the scene. It will also not let you manually add collision shapes through the inspector.

Trying to resize the array results in this log message:

scene\resources\mesh_library.cpp:237 - Condition ' p_shapes.size() & 1 ' is true.
Resize Array

Steps to reproduce:

  1. Open the ‘Platformer 3D’ project.
  2. Select the tiles.res file, go through the items in the inspector and notice how it has shapes for collision data.
  3. Delete the tiles.res file in the project structure.
  4. Open the tiles.scn file.
  5. Attempt to recreate the tiles.res file with ‘Convert To… -> MeshLibrary’.
  6. Select the new file and notice how no shapes are defined.
  7. Try to add shapes manually and notice how it will not let you change the array number.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (11 by maintainers)

Most upvoted comments

Reading the source code, I found the issue in my case. When converting a scene to Mesh Library, to take into account collision shapes, you must have the following tree: MeshInstance>StaticBody>CollisionShapes[] In my case I had the following tree: StaticBody>[MeshInstance, CollisionShape]

Maybe the gridmap doc page should be updated

ping @madmiraal @akien-mga

Well, like Giacom said, this one is very important, no collision == no use of GridMap in much case. While Godot 3 is focused a lot on 3D, it’s a bad thing not to be able to use it

Reopening, because I’m still experiencing the issue as originally described in both 3.2.2 and master 9e34ba4 i.e. when trying to create a MeshLibrary using Scene -> Convert To... -> MeshLibrary... or add to a MeshLibrary using Mesh Library -> Import from Scene the MeshLibrary doesn’t contain the scene’s CollisionShapes, and there is no way to add them manually.

I am using Godot v3.4 stable as of today, branch [206ba70f4] and am having the same issue.

I tried using the scene order that @Datoh described without success. I even opened up the gridmap demo project in the Docs (https://docs.godotengine.org/en/stable/tutorials/3d/using_gridmaps.html) and have the same issue. Is there a workaround?

This seems to be fixed in 3.1, I was able to create a non-cube collision shape that retained its dimensions in the game. Note that the collision shape has scale factor of 1, the shape was determined using the “extents” property.

image

image

I was able to reproduce the issue with 531dc2f435c1d64a2e3ef0710cc05a7c13969587. I also noticed there is no visible rendering material after the generation of the MeshLibrary (GridMap geometry is white)