How do I direct my AI character to appear in front of camera?

My game is a 2D platfromer game with orthographic camera(of Character blueprint) and 3D characters , I want to implement a system where when a AI character kills player character, AI moves in front of the camera covering the screen space.

I tried a lot taking player character location as a reference but it’s not perfect, I think if I could get character’s camera location and rotation then this would work perfect (correct me if I am wrong).

What should I do?

How do I get camera location and rotation that can be pass to AI? (I can grab camera location and rotation but it’s relative location of Player character Blueprint)

How to set AI location and rotation towards camera? (currently I am using ‘Move Component to’ which computes only relative location and rotation)

Hi ,

What you should be able to do is type in “Get Camera World Location” from a cast to the player or in the player and pass that to the AI, then do a VInterp to move the AI to the camera location or just in front of it. I attempted this on my end and was able to get the world location of the camera from the player character, so casting to the player character you should be able to do the same, please let me know if this works for you.

Yup it worked :slight_smile: thanks.