Download

Multisphere Trace not detecting VR Pawn ?

Hi,

I’m currently following this tutorial from the epic WIKI : https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/index.html

… trying to make it work with the VR template. Everything is working fine except the Multisphere Trace for Objects in the “AgroCheck” service, which is configured to find pawns around the AI character, doesn’t seem to find the “VRPawn” (but it traces right to the spectator pawn !). Is the VR Pawn not an actual pawn ? Or am missing something ?

Thanks for your help

How does your VR Pawn look like? Does it have any collision volume or mesh in its hierarchy? Or is it just a VR Origin + Camera?

Hi ! Thanks for coming to help !

My VR Pawn is indeed just a VR Origin + Camera. It is the default MotionControllerPawn that can be found in the VR template. I tried adding a capsule collision to it but nothing changed.

If I put another type of pawn in the level, it works just fine and the character walks towards the pawn.

Just for the sake of debugging, can you try to change the parent class of the VR Pawn to Character and see whether this makes any difference? I suspect that there is still no collisions triggered by your pawn.

Turning the pawn into a character did the trick ! My NPC walks towards me and then kicks me in the face. However I do not understand why since, Desired Object Types for the multisphere trace was set to Pawn (EObjectTypeQuery -> One element set to pawn). Thanks a lot anyway.

By the way, when I’m previewing the game in VR, the root of the motion controller pawn is set at a short distance away from me. However every X and Y coordinates are set to 0. Is there a hidden hoffset somewhere ?

Well, if you like to be kicked in the face… :wink:

You should be able to get a collision working also with the previous Pawn setup provided you have a collision capsule as its root component. Just adding a collision capsule to it as part of the hierarchy doesn’t work.

To your second question, the VR Origin (scene component the Camera is parented to) is what creates the offset respect to the Pawn origin. In general you can use Reset Orientation and Position to realign them.

Thanks for the information, is that related to that calibration thing I can see on many SteamVR games ?

Should I think of making this mandatory for the player by placing a level at the start of the game to reset position and orientation ?

Anyway, you helped me a lot ! Now I can fight with my character :slight_smile:

@clav Indeed, this is one of the reasons why most VR experiences have an initial “calibration” step. It is best practice to offer your players to possibility to recenter themselves in VR as they may start the experience in a different position than the one they want to play in.

A common scenario is: you are sitting in front of the computer when you launch the experience, but ultimately you want to stand up and play it in the middle of the room. If the experience assumes your initial position is the playing position and doesn’t offer any way to recenter, the player will find themselves offset (and with the wrong height too).