so i made a movement script and when u spin and go forward it goes the original forward and not the new forward, how do i fix this?
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
//rb.AddForce(0, 0, forwardForce * Time.deltaTime);
//if (Input.GetKey("space"))
public class Movement : MonoBehaviour
{
public Rigidbody rb;
public float forwardForce = 1000f;
public float turnForce = 50f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKey("w"))
{
rb.AddForce(0, 0, forwardForce * Time.deltaTime);
}
if (Input.GetKey("d"))
{
transform.Rotate(Vector3.right, turnForce * Time.deltaTime);
}
if (Input.GetKey("a"))
{
transform.Rotate(Vector3.right, -turnForce * Time.deltaTime);
}
}
}