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

Created on 6 Oct 2017  路  11Comments  路  Source: godotengine/godot

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.
bug confirmed hero wanted! core

Most helpful comment

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

All 11 comments

The current implementation has a static body per octant, so as far as i know its not currently possible to have per cell collision data, however the gridmap should then provide a general collision properties that will be applied to every octant.

We have now entered release freeze for Godot 3.0 and want to focus only on release critical issues for that milestone. Therefore, we're moving this issue to the 3.1 milestone, though a fix may be made available for a 3.0.x maintenance release after it has been tested in the master branch during 3.1 development. If you consider that this issue is critical enough to warrant blocking the 3.0 release until fixed, please comment so that we can assess it more in-depth.

I'd say this issue is pretty important to fix.

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

I don't understand this issue. You can't create a MeshLibrary manually, you need to generate it from a scene. What you ask for is an enhancement but it's clearly not a bug.

wait i think i misunderstood

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)

This issue is still present in 3.1 Beta 3. Although I am not sure if it is exactly the same...
After conversion, the collision shapes attached to GridMap tiles become deformed and completely useless. Basically all my BoxColliders have been deformed during conversion.
Please look at the difference:
1st is Mesh in a scene, seen from editor
2nd is GridMap tile, seen from camera on runtime, with Visible Collision Shapes enabled
tile
tile_gridmap

This is important issue which prevents effective use of GridMaps at this stage.

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

Thanks, closing.

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.

Was this page helpful?
0 / 5 - 0 ratings