You must use the kinematic body, but you cannot change its position manually, you need to change its speed for the dynamics and collisions to work correctly.
I propose the following algorithm:
1st - Calculate the position on the track where the body should be on the next dt.
2nd - Make a vector going from the position where the body is in the next position.
3rd - normalize it.
4th - calculate what speed you need so that the body is in this position in the next cycle and multiplies this speed by a vector.
5th - apply this vector to the linear velocity of the body.
Note: make sure the kinematic body has zero resistance, so itβs easier to calculate the 4th step.
I have never done anything like this, I think it can be done like this. Hope this helps :)
source share