UxrManager.RotateLocalAvatarAsync Method

Asynchronous version of RotateLocalAvatar(Single, UxrRotationType, Single, Action, Action(Boolean), Boolean).

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 Task RotateLocalAvatarAsync(
	float degrees,
	UxrRotationType rotationType = UxrRotationType.Immediate,
	float transitionSeconds = 0.1f,
	Action rotatedCallback = null,
	CancellationToken ct = default,
	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.
ct (Optional)
Type: System.Threading.CancellationToken
Optional cancellation token to cancel the operation
propagateEvents (Optional)
Type: System.Boolean
Whether to propagate AvatarMoving/AvatarMoved events

Return Value

Type: Task
Awaitable Task that will finish when the rotation finished

See Also

Reference

UxrManager Class
UltimateXR.Core Namespace