Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 difference = player.position - arm.position;
- difference.Normalize();
- float rotZ = Mathf.Atan2(difference.y, difference.x) * Mathf.Rad2Deg;
- arm.rotation = Quaternion.Euler(0f, 0f, rotZ + rotationOffset);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement