Switching between multiple cameras within the Character.

Hey all, I’m looking for simple blueprint functionality for switching between two cameras inside of a character component. I have found a similar post, however the “answers” are not very straightforward and quite confusing. I’ll explain what I have been trying.
Within the “MyController” blueprint, On Key F Pressed, Switch to second camera. However I can’t seem to reference the cameras located within the MyCharacter Components. This is quite a hindrance for me. Can someone explain a bit better how this could be done? thanks in advance!

Hey dylenbrivera,

If you have multiple cameras within your Character blueprint you want to switch between, you can use the Set Active node that has a boolean New Active to deactivate one camera and activate the other. If you need to call these cameras and functions from outside of the Character blueprint, you’ll need to Get Player Character and Cast it to your Character Blueprint, then you can access the cameras with a Get and use Set Active as I mentioned. Here is an example setup you could use in your Controller blueprint:

Hope this helps!

-Steve

Thank you for your reply. I’m trying to replicate* the above example, however I cannot find the “Cast To TestingCameras” node. Is this a custom node?

I see, I was able to accomplish what I was aiming for with the “Set Active” node. Thank you very much Steve, I’m highly impressed with your effort to help me out.

Hey man can you post you bluprint you did with the set active node as a image so i can see it. Thank you in advance!

Sure Ivailo, so as you can see in the following screenshot

, I have both cameras located inside this same character blueprint. I made a custom event which would can be called to change the cameras when needed. Pay close attention to the use of the disabling and enabling of cameras with each “Set Active” node. First, the active camera must be disabled. Second, your new camera must then be enabled. For the flip, reverse the effect. This works well for me, and does swap the camera. However I haven’t been able to successfully blend the transition like when the “Set View Target with Blend” node is used. If anyone reading this has a solution, please let me know. Glad to help out Ivailo!

1 Like

Hello,

Jumping into the conversation with an additional method of handling it. I added an ArrowComponent to my character Blueprint below for reference.

In the Graph, I used a FlipFlop like you did but I set the default location of the camera (over the shoulder) prior to starting a Timeline (3 seconds) which is used with the VInterpTo node to blend it smoothly to the new location which is my ArrowComponent (AltCamera).

When F is pressed again, it executes a similar sequence except it uses the Timeline/VInterpTo process to blend down to my DefaultCamera I set before.

Plenty of ways to handle this, this is just another approach. :slight_smile:

Edit: This is just reference, you may need to add a branch to check if the camera is in the process of transitioning already and move up or down depending on the direction it’s currently moving.

Hope this helps,

-W

1 Like

This is fantastic, I actually tried a similar method about two days ago but was unable to work it correctly. I used an invisible sphere instead of an ArrowComponent but I see how the ArrowComponent would work better. This community is amazing. Thank you guys!

Wes Bunn, The “ToBird” and “ToPlayer” nodes appear to be some kind of custom vector nodes. Can you share a bit of information on what you did to create/call those nodes?
EDIT* I now see that what you did was create a custom timeline(Add Timeline). Took me a moment but I got it.

No worries. Let us know if you need help with the branch setup to check if the camera is in the process of moving to a new location as I could see how that might through a kink into this setup.

-W

@Wes Bunn I’ve tried your solution but I have few questions:

First, why are you adding the movement vector from timeline to the result of vinterp. Isn’t it the final position?

Second, I tried a side view camera instead of a bird view. But, when the camera reaches the side angle it starts rotating in all kind of directions. How to fix that?

If you want to have a look at my blueprint setup, I can show it to you. But please help.

Thanks you.

Hi Wes – I’m trying to figure out how to interp back to the base camera now.

Also I’ve been having problems getting the setup you posted to work. Here’s what I have so far:

I’m not sure why yet, but the camera pops on the initial keypress down but only a few cm. On release though it moves up into the sky. My timelines are set with the Movement track and a key at time 0, value 0, and another key at time 1, value 1. How should I be setting the delta time variable?

Is there a way to possibly do this with Set View Target with Blend inside the character BP? That would be ideal. But it looks like it’s only usable on the level BP? How to temporarily change player camera to "external BP" camera? - Cinematics & Media - Unreal Engine Forums

How did you get the “Set active” nodes from the earlier screen shot you posted, where it says “Target it ActorComponent” below the title?

Never mind i found out, but this was very helpful.
†ℌαηḱṧ‼ (Alt code word)

not sure if this would help but i put a tutorial on a simple camera location switch that can be activated on the press of a button and a return to default on release.- YouTube

For anyone else - Here’s a simple way to switch cameras from the level blueprint, and casting a camera that’s in a Pawn blueprint.

Don’t forget to have the camera attached to a boom in the Pawn blueprint.

Hi jmalaske,

I know this is a super late answer and you probably know that how to add ‘delta time’ in the character BP.

For future reference, you can add delta time by creating Tick event in the character BP. Once create Tick event which has a float name as ‘Delta Seconds’ promote this and put the name whatever you want like ‘delta time’ and use this. :smiley:

you can also do what I have been testing and move one camera on a arm to different locations by changing an enum

so first person view might change arm length to 0 with a 0,0,0 rot, and third person would have an arm length of 650 and a rot of 0,-40,0 and using a timer you can slowly move the camera in and out, or even using the scroll on you mouse make a smooth transition.

then first and third become one camera, and top down would be just as easy at a 0,-90,0 rot, and the only difficult parts would be shoulder view where you might set a second camera, or use a larger blueprint to turn camera, and the arm.

Or just that