Hey Everyone,
Trying to figure out how to let my VR character teleport around a spaceship while it’s moving… there’s a few posts in the forum about this now but no solutions
I did find this youtube video: Unreal Engine: Moving Platforms With Navigation in VR - YouTube
And he does try and explain it in a comment, but I can’t figure out how to do what he’s saying:
In VRPawn blueprint:
- Add the collision type of your moving mesh (such as WorldDynamic, or I created a new one called DynamicPlatform) to the existing array of acceptable types for the navigation raycast
- In the IsTeleportValid function, add a switch based on the HitResult collision type. If it’s WorldStatic, continue on to the existing logic so it works as normal, which finds the closest point on the Navmesh. If it’s your moving mesh’s collision type (again WorldDynamic, or create your own), create new logic which returns the hit point on the mesh itself. You can get fancy here and add extra logic to make sure you’re not selecting a point on the side or bottom of the platform.
- Add a box collision parented to the VRPawn camera for the next step…
In your moving platform blueprint:
- Add a box collision over the platform.
- OnBeginOverlap with the VRPawn’s box collision you added in the last step, use AttatchToActor to attach the VRPawn to the moving platform, maintaining world position, so that the player moves with the platform when he’s on it.
- OnEndOverlap, detach the VRPawn from the moving platform, again maintaining world position.
To start with, where do I edit the “existing array of acceptable types for the navigation raycast”?