Spectator Pawn Camera Manager

Hi guys, pretty new to unreal engine here. I am trying to make a feature in my game where it will place an interactable crosshair dot widget on my viewport when the player’s camera is a certain distance from an interactable object. I saw a tutorial video and they used line trace by channel which input is reliant with knowing the camera’s position. I am possessing a spectator pawn as my character and I’m not really sure on how to get the its camera component as it is not showing in the components tab. Please do let me know if anything is not clear. Thanks alot!

1 Like

Hi Chris!

Thanks for posting, I hope me or someone else here can help you out.

Usually, you could have a blueprint related to the player pawn or another pawn, and use the blueprint script associated with it to contain some logic.

As far as the crosshair idea goes, sounds cool! If you don’t want to mess with the camera distance, you could try using a collision box, and have an event fire whenever the box overlaps with a specific object. Here is a video example: https://www.youtube.com/watch?v=5-UJT4U-jeg.

However, if you want to calculate distance from the camera to an object nearby, my first attempt would probably be to:

Play around with these ideas, and let us know how it goes! No rush.