UxrManager.TeleportLocalAvatarCoroutine Method

Public teleporting coroutine that can be yielded from an external coroutine. Teleports the local UxrAvatar. The local avatar is the avatar controlled by the user using the headset and input controllers. Non-local avatars are other avatars instantiated in the scene but not controlled by the user, either other users through the network or other scenarios such as automated replays.

Namespace: UltimateXR.Core
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public IEnumerator TeleportLocalAvatarCoroutine(
	Vector3 newFloorPosition,
	Quaternion newRotation,
	UxrTranslationType translationType = UxrTranslationType.Immediate,
	float transitionSeconds = 0.2f,
	Action teleportedCallback = null,
	Action finishedCallback = null,
	bool propagateEvents = true
)


Parameters

 

newFloorPosition
Type: Vector3
Floor-level position the avatar will be teleported over. The camera position will be on top of the floor position, keeping the original eye-level.
newRotation
Type: Quaternion
Rotation the avatar will be teleported to. The camera will point in the rotation’s forward direction
translationType (Optional)
Type: UltimateXR.Locomotion.UxrTranslationType
The type of translation to use. By default it will teleport immediately
transitionSeconds (Optional)
Type: System.Single
If translationType has a duration, it will specify how long the teleport transition will take in seconds. By default it is TeleportTranslationSeconds
teleportedCallback (Optional)
Type: System.Action
Optional callback executed depending on the teleportation mode:  
  • Immediate: Right after finishing the teleportation.
  • Fade: When the screen is completely faded out and the avatar has been moved, 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 teleportation.
finishedCallback (Optional)
Type: System.Action
Optional callback executed right after the teleportation finished. 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

Return Value

Type: IEnumerator
Coroutine enumerator

Remarks

If Fade translation mode was specified, the default black fade color can be changed using TeleportFadeColor.

See Also

Reference

UxrManager Class
UltimateXR.Core Namespace