Hello everybody. I did my reading and I am aware that this is an old issue with Ammo.js not giving the collision details to play canvas.
Did anybody find a solution for this? My game is something a little bit like pong, I spawn more than one ball and collision not firing happen a lot. I tried to work my way around the issue, ignoring it and creating a detection system not as accurate as collision but it is way more messy in game play now because of all the ‘ghost balls’ that do not fire collision events.
How did you solve this Ammo.js issue in your games?
It is not just the paddles. Some static objects with rigid bodies too (yes, I am setting then with teleport). I did some small testing area and even in that area at a random change there is no collision callback received.
Also, I am moving the ball by directly setting the liniarvelocity…I do this because the ball acts weird on bounce otherwise…(Friction and Restitution set on 0 on everything)
My guess is that using teleport might be an issue as you can teleport an object into another and perhaps it doesn’t trigger the collision event when that happens.
I am using teleport just once when the object is spawned to place it where I want. For the movement of balls I am directly setting liniar velocity like this:
Sure. I prepared my test scene too. Just hit play and you will be able to test it without opening additional tabs. Sometimes the ball will work just fine, sometimes not.
Actually I noticed that the issue is still not fixed with bigger half extent and CCD on. I opened 2 different tabs to simulate a multiplayer game and it still has issues
Sorry for the late reply. Downsizing everything greatly improved performance. I think I still have the issues to understand how to configure CCD. For swept sphere radius is simple since my ball is a 1x1x1 cube and the sphere radius is set to default 1.
Now…how do I accurately set Motion Threshold? And, if my velocity keeps changing, is there a way I need to update it? 0.1 Motion Threshold seems to work best with 14 Velocity in my case but around 28 velocity it starts to go back to the older issues.
Good to know. The description of Sphere Radius says the opposite: 'This should be below the half extent of the collision volume. E.g For an object of dimensions 1 meter, try 0.2'
Hello.
I have the same problem.
I am using the “setLinearVelocity” method with high speeds.
The object is overcoming the obstacle.
I fixed the stepSimulation method with parameters (0.01, 0)
but it still doesn’t work.
when I slow down the collision works.