Hello, I created a trigger box that activates a camera, and I want the default camera that follows the character (FollowCamera) to also activate when I hold down a key while inside (So that the player can switch to first-person view.).
I really need help with this…
Thank you very much.
Of course this can be done better but I hope it is clear enough.
Please note that you have to store the state IsExternal in order to return to the correct actor when exiting First Person Mode.
Edit: Also note that internal switching does not support transition so if you want that you should probably use a single internal camera and animate it with timelines or do some clever view movement in the camera manager before switching.
The graphs I showed you are in the Character as it was faster for me to do it and screenshot it all in one place.
You can spread the code however it seems logical for you - half in the Character and half in the box - no problem. Better yet you can set most of it in the controller. The controller has a camera manager object which would be most appropriate place but I’m lazy. (also the logic is pretty much the same)
In the character we make it similar with very few changes:
Isn’t there an easier way to deactivate the box or the camera? For example : using the same input that activates the “third camera” and deactivates the camera or the box at the same time.
I’m a beginner, I understand what can be activated inside and deactivated outside a box, but not on overlay… (I probably misspoke too)
Here’s what I currently have in-game: (redbox for third camera activation) :
Easier than one node? You have to switch 2 things (the view target and its active camera)
I see that your first person camera is not working when you have external camera and that’s probably because you don’t change the view target back to the pawn.
If you are looking through the external camera, changing the active camera in the pawn will have no effect since the pawn is not the view target. When you go in first person you have to set your pawn as a view target, among other things, if it is not already. (When you exit first person you will have to again change view target if there was external camera active)
I still can’t… If I’m not mistaken, the logic is to deactivate the external camera to activate the FP Camera attached to my character when he’s present in the box. I don’t see how to make the link between ActorCamera (Box) and ThirdCamera (BP_Character), they’re two different EventGraphs and the variables aren’t the same.
By studying your answers, I realize that I don’t have an interface… I should already look into it.
I tried a new project with this tutorial, it’s working but the method doesn’t suit me (I don’t know how to activate the camera rotation this way):