AI Shoot at a Focus Pawn but doesnt get the Z axis

I m facing an annoying issue. I m devlopping a game for the Vive and as you might already know, moving in your room scale doesnt move the root capsule compenent of the player. So When I set the focus of my AI to the character they are shooting always in the middle of the play area no matter where the player is in his room scale. So I created a separate pawn that on every tick is adjusting is transform based on a “Box collision” (Called capsule boxe collision in my scene) that is created inside my character/player. This Box collision is a child of my camera. So everything is working perfectly the pawn is following the camera (HMD) (I created a box a bit offset in the pawn to have a debug and see if it’s always in the front of the player view) BUT my AI are shooting on the body always to the same height, no matter how high the camera (and the pawn which is the focus) is. This is annoying since a player can hide his body behind a piece of decor while seeing on top and being able to shoot the AI without being shoot because the Ai will keep on shooting to the same height. This is a bit confusing to explain, I hope you will see it a bit more clear with the screen shoot.

a

I had a similar problem, but I don’t have AI shooting so the solution may not be applicable.

My AIs would not focus on the HMD when set to focus. That was because the default AI controller returns GetActorLoction() from the call to GetFocalPointOnActor. I overrode GetFocalPointOnActor in my own AIController and changed it to return GetComponentLocation() from the camera component on the Vr Character when the focus was a Vr Character (otherwise just GetActorLocation as normal.

That works for normal focus, so may work for your shooting problem as well, as opposed to your workaround.