unity get player facing direction code example
Example: move in the direction that player is facing unity
float movementSpeed = 100f;
void Update()
{
rb.GetComponent<Rigidbody>().velocity = transform.forward * Time.deltaTime * movementSpeed;
}
float movementSpeed = 100f;
void Update()
{
rb.GetComponent<Rigidbody>().velocity = transform.forward * Time.deltaTime * movementSpeed;
}