I have a simple ground box and walls with collision and a rigbody.
The red box (player) has the same applied to it plus the player-move sript. You can see the sript below.
As you can see in the gif here, sometimes the collision does not work and I have no freakin idea why? It’s a simple setup but it doesn’t work constantly. I have tried a lot, not sure if it’s something in the editor or in the script?
Any ideas?
This might have to do with the scale of your objects. It’s best to use realistic sizes for your objects and physics as in 1 playcanvas unit = 1 meter. What size are your objects there? Also it’d be useful to have a link to your project.
Yep, I have done that before. The collision of the wall is now at 100x 3y 10z to test but it’s still not working. If I press Up Down Keys to move the box… after 3, 4 collision hits the box moves through the wall
My ground was a plate with collision y1. Seems that does not work.
Replaced my ground with a same sized box with y1 and collision 1. I hope that was the problem
OK, here’s another suggestion. With Bullet/Ammo.js (PlayCanvas’ physics engine), it’s generally bad to have very, very big bodies collide with very, very small ones. That’s just how the physics engine works - nothing we can do about it.
Try to have a better level of proportionality.
So either you could:
Make the dynamic body larger.
Make the environment out of a polygon mesh (constructed in Blender/Maya/3DS Max).