- Home /
How can I rotate around with a Rigidbody while respecting physics?
Hi all,
I am making a game in which the player (car) can move forward and only steer by rotating around an object. The moving forward is done by wheel colliders and works as intended and the rotation with setting the center of mass to the object I want to rotate around, followed by setting an angular rotation around it. It does stop when it bumps into a collider, so that it good.
Although this works, I do stumble against some problems with it. One of the problems is that the rotation is also sometimes pushing the player in the air. This is not what I want. I want the car to be grounded at all times and if not grounded, at least fall to the ground. Basically just respect physics. It also does a wheelie onto it side wheels from time to time while rotating.
Included in this link you can find an example of what I mean. At roughly 10 seconds, you can see it go into the air for a bit which repeats itself after a full rotation.
The code that I use to calculate the velocity is very simple in which radius stand for the radius of the circle it should rotate in:
grappleVelocity = transform.up / radius;
Is anyone familiar with this problem or know what can be done to prevent / solve this?
Thanks upfront!
Your answer
Follow this Question
Related Questions
How may I observe expected physical interactions while using Rigidbody.MoveRotation()? 1 Answer
Camera and mesh not colliding 1 Answer
What is the most accurate method of calculating total rotations of a rigidbody? 1 Answer
drag object including free rotation 0 Answers
AddRelativeTorque() Applied Incorrectly When Using a Custom Centre of Gravity 0 Answers