I am trying to make the player move towards the way it’s facing, but even though it’s rotated it still moves relative to the global axis. how do i make it move relative to it’s local axis?
this is my code so far:
Vector2 direction = new Vector2 ();
direction.x = Input.GetAxisRaw ("Horizontal");
direction.y = Input.GetAxisRaw ("Vertical");
direction.Normalize ();
rig.velocity = direction * walkSpeed * runMultiplier * Time.deltaTime;