[SOLVED] Tiled floor collision issue

Hi, i use a tiled floor in dungeon, i have a floor template with static rigidbody and a collisionbox, when i duplicate the template i enbale it, set the new location and enable the entity and the collision and rigidbody, but the player keep falling through the floor, have done many tries but not able to solve completely the issue. Is there some correct way to activete all the components to avoid the fall?

I remember an issue where a newly instantiated template defaults to (0,0,0) during the first frame, regardless of settings.

Is the player already at the expected collision position during that same frame? If so, you might need to instantiate the entity a bit earlier.

Oh so you mean some collision split from the entity while the tiled floor is created, but it strange coz seems more like a physic issue since suddenly while walking the floor there is a tunnelling in the floor and also if i have made a recovery system that put the player over the floor again it keep falling at 10.7 speed down. Seems a crash of ammo but can’t find out why it happens.

You need to provide more information to solve this. It sounds like you’re guessing about ‘crashes’ while it’s likely a setup issue.

  • Collision: Are you using Mesh or Box collisions? If it is a mesh, try Box primitives for the tiles to see if it is a problem with the mesh.

  • Movement: Are you using entity.setPosition() or similar manipulations? Using those on an active rigidbody will cause ‘split’ and sync issues.

  • CCD: If your player speed is very fast, maybe you need to enable Continuous Collision Detection, but I don’t think that’s the case here.

Can you maybe create a sample project or show some code snips or screenshots?

Yes the rigidbody is static, the collision is box, the movement is linearvelocity, but i use lookat on the entity to turn the player, i just changed it to model instead so it wont affect the rigidbody, (have yet to test it), the strange thing is that since it happens randomly i guess it’s due to a piling of micro events that suddenly overflow so i am trying to remove all possible micro issues. In a first moment i had 2 listener that fired the floor building that made me loose 2 weeks before realizing it, but now is something else. I now try the new changes if things don’t work i will post the link.

i am still laughing

ok solved the tilt problem, and seems i am on the good way to solve the tunnelling problem, a lot more stable now, here is the link to the dungeon creation and to the project anyway

Now everything works as it should. Need champagne to celebrate!

1 Like

What was the cause and how did you solve it?

Beside the two listeners that triggered the create floor twice, while getting the floor template, i had to enable the tile, disable the collision and the rigidbody, call the setposition and enable again the collision and rigidbody, had to use the setposition instead the rigidbody.teleport that on static rigidbody seems to have issues. Changed the player rotation system removed the lookAt apllied on the entity and used the rotation of the model instead. All thtat resolved the tunnelling issues. The main culprit of the random tunnelling was indeed the lookAt on the whole model. I have to find a way to avoid glitching based on fps sudden drop and recover that may cause a lost of collision but seems stable enough, will know more when many players will interact.

Note: We’ve moved away from using the ‘solved’ keyword in titles. Please use the built-in ‘solution’ button from now on. You can find the button to the left of the ‘like’ button on every post.