Hi, I am trying to activate a camera within a Pawn and set it as the main camera. The camera will follow another pawn that is controlled by the player. When a button is pressed the camera pawn is possessed and the player can then pan it around.
I am having difficulty setting the camera pawn to activate. I have the following set up in the pawn blueprint:
Does your camera change if you drag in your camera reference using “Get” instead of using “get owner”? If not, does your camera work when setting this up in your level blueprint?
I am casting this off the BP_MainCamera blueprint (screenshot in first post). Running this in game, it does print the camera object name, but does not show from that camera.
When I run the game, this is what I have in the outline:
It is very possible that your actor you are running this code is spawning before the camera actor. Which would make this fail thats why your delay works.
Two ways are:
use your delay but try some lower values til either it fails again or it happens instantly.
Use the delay until next tick with a validated get on your camera actor target to detect when it is valid:
Just make sure the target actor is there or risk an infinite loop error
(Validated get is done using a normal get, right click the get node and convert to validated get!)
Also consider setting the BEGIN camera as an actor so you control where it starts from. Unreal will use some default view as a camera view if no cameras are set and available at runtime.