I’ve been trying to solve this for the past few days. I’ve been trying to find a good solution to this problem but I cant find any. I’m also new to to Rigidbodies in Unity so any help is appretiated!
Okay, so the thing is I want a RigidBody (Player and almost everything else) to move along different curves in my game.
When working only with the transform, the following code works just fine:
(I’m using my own function here to find out the up-vector at the transform’s position)
// Set the transform.up vector to the curved plane up-vector
transform.up = GridUp (transform.position);
But when trying to modify the RigidBody rotation to the up-vector, the result is wierd. Also when reading other posts one should not chnage the rigidbody rotation and position directly, but instead use the AddForce() and AddTorque() funcions.
My questions is:
How do I rotate a RigidBody to a specific up-vector, and keep the functionality of the RigidBody physics?
Example picture: Moving a rigidbody box along a slope (Red arrow) with rotation around the slope y-axis (Green arrow)
