Question by
Ryanred5 · Jul 18, 2019 at 12:41 AM ·
movement3drotate object
How do I rotate my character when it turns?
I'm using this movement script
void Start()
{
rb = GetComponent<Rigidbody>();
}
void Update()
{
Vector3 mi = new Vector3(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
mv = mi.normalized* speed;
}
private void FixedUpdate()
{
rb.MovePosition(rb.position + mv * Time.fixedDeltaTime);
}
and I am using it in a flying game. I want the character to turn when it moves but I don't know how to do that so if anyone can help me thanks.
Comment