how to make a object move in the direction it is looking unity code example
Example 1: unity movement on forward
transform.position += transform.forward * Time.deltaTime * movementSpeed;
Example 2: move in the direction that player is facing unity
float movementSpeed = 100f;
void Update()
{
rb.GetComponent<Rigidbody>().velocity = transform.forward * Time.deltaTime * movementSpeed;
}