Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Vector3 vector;
- Vector3 axis = Vector3.up;
- float angle = 45.0f;
- // Rotate a Vector3 by an angle on a given axis
- vector = Quaternion.AngleAxis(angle, axis) * vector;
- // Flatten a Vector3 on the Y-axis
- float oldMagnitude = vector.magnitude;
- vector = new Vector3(vector.x, 0, vector.z).normalized * oldMagnitude;
Add Comment
Please, Sign In to add comment