- Home /
Problem with fast physics
Hello,
i am trying to simulate rotating hammer (no gravity, kinematic) colliding a ball, something like croquet. Everything works well until i rotate the hammer really fast. Sometimes the ball sticks to the hammer, sometimes the ball ignores the collision.
I think when the rotation is too fast, the hammer goes through the ball or appears in the middle between frames. So i am not able to hit the ball fast. Is there any solution for this? Putting the rotation into FixedUpdate didn't work.
Thanks
You;ve got interpolation and/or extrapolation turned on? Could also try changing the rotation of the rigidbody with $$anonymous$$oveRotation and you are rotating the rigidbody not the transform right?
If ypu're doing all of the above and still have issues, you can also adjust the fixed time step for more accurate physics. Other than that, you'll have to do some mathy stuff... taking the hammer''s velocity, estimating where it will be on the next frame and deter$$anonymous$$ing if there should be a collision from that. I haven't had to do anything like that yet but there is a script here:
Thank you both for your answers. Rotating the rigidbody ins$$anonymous$$d of transform helped alot, now it behaves more realistic. I also tried to set interpolate and dynamic collision detection and it seems to be the best settings.
But the problem still occurs when the movement is really fast, event with $$anonymous$$imum fixed time. I think the only solution left is to do some coding, but i cannot use the script you posted above since the movement is rotational, the object position doesnt change. So i think i cannot use raycasting here. Do you have any idea how to modify this script for my case?
Thank you
Your answer
Follow this Question
Related Questions
How to stop an rigidbody enemy from jumping when chasing the player? 1 Answer
i need help with my skateboard physics 0 Answers
RigidBody.MovePosition seems jerky in movement 0 Answers
Is there support for continuous collision detection / fast collision detection in unity? 2 Answers
Why can't I shoot my bullet down? 1 Answer