I have the following setup in the 1st person template example: 2 cubes that are placed right next to each other, a projectile falling near the intersection of the 2 cubes.
What happens is that the projectile passes through Cube1 (white) just a little bit, before the collision is detected, resulting in the projectile also colliding with Cube2 (blue) in the same frame. Because the projectile hits Cube2 right on the edge, it causes it to bounce not only back up, but it also gives it a lateral impulse towards the left.
Any ideas on why this is happening considering that I do have CCD enabled on the projectile ?
Hi TJ. These are the standard assets from the FirstPersonExample map. 2 cubes with simple collision and the FirstPersonProjectile mesh which is a simple sphere collision. I gave the projectile a weight of 20kg and set it at a height of 6 meters. The issue does not occur every time. It’s about 2/5 and it happens more with lower FPS.
I wasn’t able to use your .umap to test the issue because it was also missing the blueprint projectile you had setup. But once I realized the 2 boxes were also simulating physics, I was able to reproduce the issue in a blank project.
What you are seeing is just a quirk of the physics engine. Physx is made to be stable but not perfectly accurate. So some physics object will have some clipping at higher speeds. The good news is you can adjust this a bit by enabling Substepping in the Project Settings under Physics. Try playing with the Max Substep Delta Time and Max Substeps settings. I was able to get the clipping to almost stop entirely, which in turn kept the sphere from bouncing off to the left.
Please keep in mind that this is still considered an experimental feature though.
Yes, substepping does help a bit but doesn’t fix the problem entirely. I was hoping to find a more definitive solution. I was thinking that maybe I can improve the CCD resolution or something, so that it can detect collisions without clipping.
Thanks for trying.