Gridmap collision doesn't work when using kinematic body

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By szabotudor

This is the meshlibrary I made for the gridmap.
When I set the cells in code, or just by adding the with click, the collision does not work, and the player passes through the gridmap.
(Iknow it works with static body, but that is slow to instance and I am using gridmaps to generate huge areas, which, with static body takes 30 secs, while with kinematic is instant)

:bust_in_silhouette: Reply From: davidoc

Gridmaps only work with StaticBody, if you look it as instant with KinematicBody is because it’s not creating them.
Huge scenes with Gridmaps are not a good idea, Godot doesn’t cull the meshes and having all those physics objects at once affect performance.
Also if using Bullet physics there is a bug that pushes objects away from the edges, so having small objects together as floor is not a good idea.