Why do I sometimes fall through a raising platform when I jump on it?
Setup: I made a static mesh platform. That when you step into the trigger box, the platform rises up 1600 units over 1 second using a timeline. When I get on the platform it rises up with me on top normally.
Problem: When I try to jump while on the platform I sometimes fall through it.
Reproduce: I can generally make myself fall through the platform right when the platform starts to lift the player by pressing the spacebar a quick couple of times.
I have Use CCD checked for my character, the mesh and the capsule component. I have BlockAll for the character and the platform.
I have placed the platform in a smallish pit, so that way I can always be completely on top of it, because I was thinking that the capsule was going slightly through the platform to cause the problem. It was worse when the platform was at ground level or higher.
How do I fix the platform / player so I don't fall through when jumping?
Thanks in advance for the help!
Hi there! I think I have had a similar problem, so may be able to help.
First I'd look at your world scale. The physics system uses world scale (1 unit = 1 cm) you are moving your character 16 meters in one second. It possible that the scale of your scene objects is having an impact.
If you jump (or step off a ledge), IsFalling is set to true on the character, it will then trace for collision, so it's likely because of the speed the platform is moving that it is returning that the character as isFalling when you jump, as it hasn't been fast enough to detect a collision hit from the bottom of the character collider to the moving platform allowing it to pass through you.
Another option worth a try is increasing the accuracy of the physics simulation
Project settings > Physics > Frame Rate > Enable substepping
Then adjust the max if you need more accuracy. Performance will be impacted so I'd have a play around, it also says its experimental.
Hope that helps!
Follow this question
Once you sign in you will be able to subscribe for any updates here