[Solved] VR/AI Perception Issues

I have created an AI routine which is based on AI Perception. When testing with a normal third person character all goes well however when testing with my VR setup (Pawn with Floating Pawn Movement) the AI Perception is unable to properly detect the VR pawn. The location of the pawn is detecting as about 30 units off center and at floor level. This never changes regardless of the actual VR pawn position or height.

I assume this may have to do with the way “room scale” or “room center” is detected in the engine in relation to the headset position.

Does anybody have any insight or tips on this as I am at a loss for how to fix or offset this.

Do you have a collision object attached to the camera of your VR Pawn? I think the perception is using a linetrace and that should be able to hit something. The default VR Pawn has no collision objects attached.

If you would at a sphere collision as a child component to the camera ( see screenshot ), it will move with the HMD and the AI perception should be able to detect you.

258182-spherecollision.jpg

Hope this helps.

Thanks for the input! I had not thought of that. Unfortunately the issue persists. My VR Pawn has dynamic holsters attached to him (they are just scene components) and I am able to spawn, lock and position them very well.

For some reason though even if I add (and position) a sphere collision, including as a child of the Camera the AI Perception still tracks wrong.

It always detects my location as about 40 units off center of my actual location and completely at floor level.

I was able to resolve this thanks to some advice I found on another (semi-related) answer.

I am still unsure why the original “perception source” for my VR pawn is way off but what I did was wait until my VR Pawn is spawned and then (via blueprints)

  • Spawn a trigger box component
  • Attach trigger box component to Camera on VR pawn
  • Get reference to trigger box component and store it
  • Use reference to “trigger box” component to react via my AI on perception events

This works just fine with seemingly no consequences. It even handles nicely when you “peek” around the corner as a VR character only triggering the AI perception when your head is visible. Thanks very much for your feedback as it encouraged me to investigate and find the answer.

Can you please explain how you solved it? any screenshot will be welcome, i dont understand you properly

Please can you explain what you mean in your last step, how can the AI perception react if its still looking for the root component of the actor? How are you changing it so the AI perception is looking for something other than the root component? thanks

Please can you explain what you mean in your last step, how can the AI perception react if its still looking for the root component of the actor? How are you changing it so the AI perception is looking for something other than the root component? thanks

I think i’ve found another solution: https://answers.unrealengine.com/questions/981048/ai-sight-perception-in-vr-solved.html