Skip to content

Frequently moving Kinematic bodies not colliding with Dynamic bodies #330

Answered by RossNordby
robinlacey asked this question in Q&A
Discussion options

You must be logged in to vote

That sounds like it is indeed because of teleporting the body. Setting the velocity should resolve the collision issues.

While tiny numerical error will arise, it won't accumulate over many frames if the velocity is set by simply using (targetPosition - currentPosition) / dt, where targetPosition is where you want the body to be after the timestep and dt is the timestep duration.

If desired, you could also simply set the position after the end of the timestep so that the position is bitwise identical to your target.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@robinlacey
Comment options

Answer selected by robinlacey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants