Blueprint Tutorial - Multiple Camera Angles

Hey ! I wanted to share with you all a tutorial on how I go about doing multiple camera angles at the moment and to have these be controlled from within the class Blueprint instead of the Level Blueprint. I couldn’t do it by simply just using a CameraComponent within the class Blueprints’s Components Window and I am not sure if there is a much better way to do this but this was something I uncovered while trying to achieve this for myself. If any of you know how to make this better, feel free to chime in.

I hope this helps you all that are trying or interested in doing this so let’s get started :smiley:

Setting Up Our Pawn Blueprint:

We are going to use the Rolling Template for this example so feel free to follow along if you want. If you do, start a new Rolling Blueprint project and we should end up here.

Let’s double click the PhysicsBallBP under the Blueprints folder in your Content Browser and open it up to modify.

PhysicsBallBP.jpg

Instead of using the CameraComponent already created for us…

CameraHighlight.jpg

Let’s replace it with a ChildActorComponent instead and name it “3rd Person Camera” and also rename our SpringArmComponent to “3rd Person Boom”. You’ll see next why we are using the ChildActorComponent instead of the CameraComponent here once we get onto the Blueprint Graph.

CameraChildActorHighlight.jpg

Once you’ve done this, we’re ready to move onto the next step.

Setting Up Our ChildActorComponents:

The next thing we are going to do is the same process over again for a couple more ChildActorComponents that will represent our other Camera’s that we will switch between. Let’s start by creating an additional First Person Camera and setting it’s SpringArm Target Arm Length and Transform to the following…

After this step, let’s go ahead and create a Top-Down Camera as well… after you follow the same steps, your’s will look like this…

The last thing we want to do here before we goto our Graph is select each one of your ChildActorComponents holding down the Ctrl Key and clicking all of them. After that, simply set the Child Actor Class combo box to CameraActor.

Before we continue to the Graph, Save and Compile your Blueprint.

Creating Our Blueprint Graph:

Now normally, the Blueprint will just default to the first camera it finds but let’s start off by specifying that we want to use the 3rd Person Camera as our starting point. Before we create the additional nodes to the Graph, create two Private Variables of Type Byte and call them CameraIndex (Default = 0) and CameraCount (Default = 3).

Here is the Graph to default our camera to the 3rd Person Camera upon startup. Note that I added an additional exec to set whether or not to constrain the aspect ratio of the camera. This is more or less to demonstrate how you could change properties on the camera. You could event opt in to setup all of your camera properties off of the Event Begin Play if you wanted.

And the last step is to hook up the functionality to switch between the different cameras

And that’s it, you now have a Pawn with a basic camera system setup! The First Person Camera is actually pretty nuts and disorienting so don’t go grabbing your Oculus Rift unless you wanna hit the ground but have fun and I hope you all enjoyed this tutorial and I hope it was helpful for you in some way. This is my first UE4 tutorial and I decided to put in some time putting this together in midst of making my next game but I saw a couple people ask and thought it would be a fun one to share and help people out with.

Take Care And Game On :smiley:

Thanks for the great tutorial.

Can you please explain what the “Target - Child Actor” nodes are, which take the child actor component as input and give something compatible with the view target as output? I cannot figure out what you did there.

Thanks a lot too. It was really helpfull to me. I Just had to set cameras to have a perfect camera movement.

[=abeccu;27900]
Thanks for the great tutorial.

Can you please explain what the “Target - Child Actor” nodes are, which take the child actor component as input and give something compatible with the view target as output? I cannot figure out what you did there.
[/]

Thanks and most definitely abeccu! It was a late night when I put this together for the community so please excuse it if some areas weren’t highlighted. That node is the “Get Child Actor” node and can be found under Variables->ChildActorComponent. You can see here where it’s listed… hope that helps.

Also, Thanks , glad it was helpful! :smiley:

Thanks a lot! That is one well hidden option right there. I managed to stumble upon it once or twice, but wasn’t able to reproduce whatever I had done. Your hint was just what I needed.

[=abeccu;28957]
Thanks a lot! That is one well hidden option right there. I managed to stumble upon it once or twice, but wasn’t able to reproduce whatever I had done. Your hint was just what I needed.
[/]

Not a problem abeccu and glad to help out. Good luck.

how to remove the “cinematic” black bar

Hi, I just followed this tutorial and noticed that the SetViewTargetWithBlend cause a “cinematic” effect on the screen. Two black bar shows up on the top and bottom of the screen. Is there any way to make it dissapear? Or is there another way to smoothly switch the camera (like the SetViewTargetWithBlend does) without any cinematic black bar effect?

Thanks.

Thanks,. will check out later.

,
Thanks for this great tuto!

Since the cameras are Child Actor, is it possible to tweak them like the capability to switch between perspective and orthographic?

I have a strange behavior with the StaticMeshes Collision. I can enter in a collision shape. If I desactivate your setup, everything works well.
Do you know why?

,

This is a fantastic tutorial, I think it would do quite well on our wiki tutorial page, located here: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

Thanks for the excellent tutorial. Been trying to get something like this set up for the past few days. Your way was much easier than what I was trying to do. And extremely simple to modify for aditional cameras.

I want to recreate this mechanic for my project but instead of one key to change camera i want to use Q and E to rotate(Q Left and E Right). Kinda like the camera in Don’t Starve. How do i make this kind of change on the BP?