Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var angle = Mathf.Atan2((player.position.z - otherPlayer.position.z), (player.position.x - otherPlayer.position.x));
- rb.AddForce(-Mathf.Cos(angle) * 50, 0, -Mathf.Sin(angle) * 50);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement