How can I set-up blueprint to perform switch between three cameras ?

Hi! I need some help with setting up the blueprint tree. I want to toggle between three avaiable cameras ( which I have already created ) with every push of “C” button. I have been struggling with these for some longer time and cannot get it to work properly…

a3443643cf25f7197cff6d08af7e8f716eb6e5df.jpeg

Should work this way:

  1. Game starts with the default third person follow camera active ( named “3rdPersonCamera” in my case )
  2. Then I tap “C” to change default ( “3rdPersonCamera” ) camera to “3rdPersonActionCamera”
  3. Then the “3rdPersonActionCamera” is active and “3rdPersonCamera” is deactivated
  4. Then when I tap “C” key again, the “3rdPersonActionCamera” is deactivated and “1stPersonCamera” is activated
  5. When the “1stPersonCamera” is active I tap “C” key once more
  6. Then the “1stPersonCamera” gets deactivated and view goes back to default “3rdPersonCamera”

How can I get this ?

I would actualy do the same thing with just one camera. You can just tweak your offset parameter. And then you can use a timeline inside of blueprints to smoothly interpolate between three pre-defined points.

I think its beter use 3 cameras for what is trying to do.
Im bussy right now but late today im going to try to answer this question.

Thanks guys! Can you give me some more detailled explanation ? Maybe with some blueprint tree construction example of similar mechanics. Thank you :slight_smile:

Ask and you will have it.
You can make what you want to do with a lot of forms. I resolved with this method.


You can copy paste in your project from blueprintue.com or from here directly


(Looks like y can't post the full copy of the blueprint because its to big, if you want to copy paste you have to get it from blueprintue, sorry)

Before to paste it you are going to need to create one variable named “SwitchCamera” with type of Integer and change my camera variables with your camera variables.
If you need more help here i am.

As an alternative, you could also use “Set View Target With Blend” (Which would allow to Interp between the two cameras to create nice transitions!)

Documentation link: Set View Target with Blend | Unreal Engine Documentation

I already thought that option but you can only use it with an actor reference and not with another camera in the same actor. Im correct with that?
What i understand Wielkiczarnyafgan is trying to do is switch between cameras in the same actor.
Offtopic… your books are awsome! :stuck_out_tongue:

Haha thanks very much :>

I don’t have the engine in front of me, but can’t you just set “Target” to either Get Player Controller / Get Camera Manager on all three and the “New Target” to each camera? :>


I can’t place “SetViewTargetWithBlend” in “MyCharacter” if i leave on Context Sensitive. So i placed that node in MyPlayerController but if you try to get the camera and place it where says NewViewTarget says “Camera Component Reference is not compatible with Actor Reference”

Ready for some magic? :wink:

In your Character BP, you want to create the “Get Player Controller” FIRST, then from the output of “Get Player Controller”, click and drag to the right. When the CBL opens up, select “Set View Target with Blend” and after that pick the cameras as per usual.

The reason the casting doesn’t let you set the camera is because it’s sending an “Actor reference” and it can’t see it’s a camera :wink:

Hum… i only can see half of that magic :frowning:
I can have now “Set View Target With Blend” node without deactivating Context Sensitive Yay :smiley: Magic works fine here :slight_smile:
but my camera still don’t want to connect to SetViewTarget land ;(
Still saying its not compatible with it. Maybe im having something wrong with my camera and they don’t want to connect?

Ah it might be a problem with using the node in MyCharacter, As I said I don’t have the engine in front of me and sometimes you get quirks like this :stuck_out_tongue:

There’s plenty of ways around it (Of course, Thanks to wonders of Blueprints) but when I get in front of the engine, I’ll figure out a simple way for you. One possible way would be to have the cameras separate from the player but attach them to it, and then simply cast them in.

Thanks so much guys !!! You are truly fantastic ! :smiley:

Works like a charm !!! Thanks once again ! :slight_smile:

Which method did you end up going with? :stuck_out_tongue:

&d=1424817337

This one, in 4.7.0 engine version tree differs a bit, but the principle is kept.