- Home /
2D collisions imprecise
I am trying to make a platformer. For the player character I am using a kinematic rigidbody because I want to calculate the jump curve myself (including physics & gravity). The platforms are also kinematic because I want them to move. I am having issues with the collision detection being imprecise causing the sprite to not stand exactly on the platform after jumping (as seen in the three images taken after three different jumps). This issue also causes the sprite to get stuck in the ground sometimes. The left image is the character inspector and the right is the platform inspector. The jump movements are done with movePosition, and I tried many things to fix this. I tried the following: decreasing the timestep from 0.02 to 0.01, using onCollisionStay to keep it exactly on the platform, adding a physics material with zero friction, using edge colliders & capsule colliders, using interpolate and extrapolate.