Switching camera between multiple positions.

Hi, I’m trying to make a camera switch between different positions, but I’m a 3D artist and not really familiar with blueprints.

I want the camera to switch between 5 positions. It should move to the next position when you click the forward button on the UI and switch to the previous position when you click the backward button.

I created a blueprint called “BP_CamPos_1” that contains a red arrow to show the direction the camera is looking. I placed 5 instances of this blueprint in the scene. These are the positions the camera should switch to.

I managed to make the camera switch to position 1 when clicking the button, but I don’t know how to make it switch back and forth between the positions.


Well, there are several ways to accomplish this. I personally think the easiest way for you is to have 5 Cameras, and take one of them according to some variable or function.

I think this way is easiest (assuming five fixed positions) because then you can pilot each camera into place, and even adjust view angles and other lens features for each one.

So if you make a single camera switcher blueprint with variables:

With a few helper functions:

Reference the cameras in the outliner:

Now you can reference the camera switcher BP and just call Forwards or Backwards on button clicks.

NOW, I know you may not be doing things this way, but the LOGIC is the same - you have an array of positions (maybe you are just using an array of transforms, for example), but you need to keep track of which element you’re on, and then add or subtract one from the index into that array (the functions I have roll over, so going backwards from zero takes you to the last camera, and going forwards from the last takes you to the first).

2 Likes

Unfortunately, I need it to work with a single camera. It’s a kind of camera simulation where you can adjust the shutter speed, focal length, and aperture through the UI, and these settings need to remain consistent across all positions.

And the user doesn’t need to set the camera positions, they are still all just fixed?

In that case, just create an array of transforms instead of camera references, and apply the transform to the CineCameraActor. The logic is still the same.

Yes.

I want to make it even simpler and just let the player move forward to the next camera position. I’m trying to make it “on clicked” and cast it directly to the character.

But I dont know how to fill the array with the camera positions.

“Editing this value in a Class Default Object is not allowed”

Is this data is being replicated across multiple levels?

No, it’s just one scene with different camera positions and times of day settings.

Sounds good, if you need multiple cams you dont have to use the cinimatic cam you can always use the basic cam to swap between if you know how to do it, generaly from the set view target with blend would work.

No, I need the CineCamera because the user is supposed to use real camera settings like shutter speed, aperture, and ISO. It’s like a camera or photographer simulation.

You fill in those reference values in the outliner, not in the blueprint editor.

But I’m still not sure you’re approaching this the best way. Again, you can still have 5 CineCameraActors in your scene that you can “pilot” into place (if you haven’t seen this, you can right-click a camera that you’ve put in your level and select “pilot,” then you can fly around the editor to where you have a good view, then you can stop piloting and the camera stays where you’ve moved).

So now you have the five locations, but there is a single, specific camera you are allowing the user to manipulate through your UI, right? Is that a Cine Camera component of the Blueprint being manipulated by the UI?

Ok, so bear with me for a moment - you’d still have these cameras, but all you want from them is their transform, so we can use what I’ve given you above, but modify the “take” function:

So we’ve added the CineCamera component to this BP, and now we are ONLY viewing what this camera sees, but we are updating it’s transform using the transforms from the other cameras.

I mean, this is programming - there are a lot of ways to accomplish what you want, but I always tend to think simplest is best. Using a reference to cameras in the level is very straightforward, IMO, I do it all the time (I do virtual production for TV, including things like virtual camera flythroughs that land on a tracked camera).

Thank you for your patience. I’m trying it your way now. Hopefully, all the settings the user can adjust in the Widget Blueprint (shutter speed, ISO, focal length, aperture) will be transferred to the separate cameras.

But how do I create this purple node at the beginning? Should it be in the construction script of “BP_CamSwitch” rather than in the event graph? If so, I can’t find the “Get Player Controller” node with the “Player Index” input there, it only seems to be available in the event graph.