Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Quaternion.ToAngleAxis

Switch to Manual
public function ToAngleAxis(out angle: float, out axis: Vector3): void;

Parameters

Description

Converts a rotation to angle-axis representation (angles in degrees).

	// Extracts the angle - axis rotation from the transform rotation

var angle = 0.0; var axis = Vector3.zero; transform.rotation.ToAngleAxis(angle, axis);