Answer the question
In order to leave comments, you need to log in
How to rotate an object in motion while maintaining its speed?
I'm still green in Unity, so I still don't understand how to rotate an object in motion while maintaining its speed and not giving a push in the other direction.
There is a sphere to which this script was attached:
public class MoveScript : MonoBehaviour
{
public Rigidbody rb;
public float force;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKey(KeyCode.W))
rb.AddForce(Vector3.forward * force);
}
}
Answer the question
In order to leave comments, you need to log in
It is possible to transfer the render of an object to a rigid body sub-object and rotate it through a simple transform.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question