Announcement

Collapse
No announcement yet.

Blueprint Tutorial - Multiple Camera Angles

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Blueprint Tutorial - Multiple Camera Angles

    Hey Everyone! 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



    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.

    Click image for larger version

Name:	RollingTemplate.jpg
Views:	1
Size:	91.6 KB
ID:	1134444

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

    Click image for larger version

Name:	PhysicsBallBP.jpg
Views:	1
Size:	43.2 KB
ID:	1134445

    Instead of using the CameraComponent already created for us...

    Click image for larger version

Name:	CameraHighlight.jpg
Views:	1
Size:	30.5 KB
ID:	1134455

    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.

    Click image for larger version

Name:	CameraChildActorHighlight.jpg
Views:	1
Size:	38.4 KB
ID:	1134446

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



    Setting Up Our ChildActorComponents:

    Click image for larger version

Name:	BlueprintComponentsWindow.jpg
Views:	1
Size:	58.7 KB
ID:	1134453

    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...

    Click image for larger version

Name:	1stPersonSettings.jpg
Views:	1
Size:	72.5 KB
ID:	1134447

    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..

    Click image for larger version

Name:	TopDownSettings.jpg
Views:	1
Size:	69.1 KB
ID:	1134448

    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.

    Click image for larger version

Name:	FinalComponentSetup.jpg
Views:	1
Size:	67.2 KB
ID:	1134449

    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).

    Click image for larger version

Name:	NewVariables.jpg
Views:	1
Size:	98.2 KB
ID:	1134454

    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.

    Click image for larger version

Name:	DefaultCameraSetup.jpg
Views:	1
Size:	130.3 KB
ID:	1134450

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

    Click image for larger version

Name:	CameraSwitchingFunctionality.jpg
Views:	1
Size:	106.2 KB
ID:	1134451

    Click image for larger version

Name:	TutorialComplete.jpg
Views:	1
Size:	80.7 KB
ID:	1134452

    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 everyone 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
    Last edited by MC Stryker; 05-03-2014, 06:29 AM.

    #2
    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.

    Comment


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

      Comment


        #4
        Originally posted by abeccu View Post
        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.

        Click image for larger version

Name:	FollowUp_GetChildActor.jpg
Views:	1
Size:	99.2 KB
ID:	1050497

        Also, Thanks Fen, glad it was helpful!

        Comment


          #5
          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.

          Comment


            #6
            Originally posted by abeccu View Post
            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.

            Comment


              #7
              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.

              Comment


                #8
                Thanks,. will check out later.
                Check my working title: The Locked Room here: https://forums.unrealengine.com/show...he-locked-Room

                Comment


                  #9
                  Hi MC,
                  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?
                  Last edited by etiles; 10-15-2014, 06:13 AM.

                  Comment


                    #10
                    Hi MC Stryker,

                    This is a fantastic tutorial, I think it would do quite well on our wiki tutorial page, located here: https://wiki.unrealengine.com/Category:Tutorials
                    Adam Davis | Marketplace Support | Epic Games
                    How to report a bug? | Installation & Setup issues? | Answerhub Bug Reports | Twitter

                    Comment


                      #11
                      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.

                      Comment


                        #12
                        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?

                        Comment

                        Working...
                        X