deltavr multiplayer 2.0
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
namespace UnityXR
|
||||
{
|
||||
public class WorldSpaceUpTeleportWorldArea : TeleportationArea
|
||||
{
|
||||
// Override the teleport request to use the world rotation and not our gameObject's transform
|
||||
protected override bool GenerateTeleportRequest(IXRInteractor interactor, RaycastHit raycastHit, ref TeleportRequest teleportRequest)
|
||||
{
|
||||
teleportRequest.destinationPosition = raycastHit.point;
|
||||
teleportRequest.matchOrientation = MatchOrientation.WorldSpaceUp; // use the area transform for data.
|
||||
teleportRequest.destinationRotation = Quaternion.identity;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user