UxrManager.RotateLocalAvatar Method
Rotates the local avatar around its vertical axis, where a positive angle turns it to the right and a negative angle to the left. The rotation can be performed in different ways using rotationType.
Namespace: UltimateXR.Core
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public void RotateLocalAvatar(
float degrees,
UxrRotationType rotationType = UxrRotationType.Immediate,
float transitionSeconds = 0.1f,
Action rotatedCallback = null,
Action<bool> finishedCallback = null,
bool propagateEvents = true
)
Parameters
- degrees
- Type: System.Single
The degrees to rotate - rotationType (Optional)
- Type: UltimateXR.Locomotion.UxrRotationType
The type of rotation to use. By default it will rotate immediately - transitionSeconds (Optional)
- Type: System.Single
If rotationType has a duration, it will specify how long the rotation transition will take in seconds. By default it is TeleportRotationSeconds - rotatedCallback (Optional)
- Type: System.Action
Optional callback executed depending on the rotation mode:- Immediate: Right after finishing the rotation.
- Fade: When the screen is completely faded out and the avatar has rotated, before fading back in. This can be used to enable/disable/change GameObjects in the scene since the screen at this point is fully rendered using the fade color.
- Smooth: Right after finishing the rotation.
- finishedCallback (Optional)
- Type: System.Action(Boolean)
Optional callback executed right after the teleportation finished. It will receive a boolean parameter telling whether the teleport finished completely (true) or was cancelled (false). If a fade effect has been requested, the callback is executed right after the screen has faded back in. - propagateEvents (Optional)
- Type: System.Boolean
Whether to propagate AvatarMoving/AvatarMoved events
Remarks
If Fade translation mode was specified, the default black fade color can be changed using TeleportFadeColor.