Announcement

Collapse
No announcement yet.

Attaching a camera and a spring arm to an actor

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

    Attaching a camera and a spring arm to an actor

    So I've got an actor, and I want to attach a camera to it via spring arm, and then make that the primary camera for the level. There are two ways to do this that I'm aware of, which are both causing issues for me.
    1. Click on the actor in the world outliner, add a spring arm component, then add a camera, and make the camera a child of the spring arm. This is fine, however, when I try to use this camera in the "Set View Target with Blend" blueprint function, I get "Camera component reference is not compatible with Actor reference". This seems to be because the function wants a "Camera Actor", instead of just a "Camera".
    2. Create a camera actor inside the scene (just by adding a "Camera" in the class search box, under place mode). I can use this in the "Set View Target with Blend" function, but can't figure out a way to attach that to the other actor, since I can't seem to make that a child of the spring arm.



    What's the best way to make this work?

    #2
    Hi and welcome to the forums!

    Have you tried creating a blueprint using the actor and setting up the camera components there?
    twitter: @NaveedHIQ

    Comment


      #3
      What do you mean by 'setting up the camera components'? I can bring the cameraActor reference into that blueprint and use it properly, but then the camera isn't attached to the spring arm at all. I can create the camera in the blueprint, but then when I try and use that camera with "Set View Target with Blend", I get "Camera component reference is not compatible with Actor reference".

      Comment


        #4
        In the blueprint viewport add a spring arm component to your scene root then add a camera component as a child of the spring arm component. The camera should then appear under Variables > Components for you to drag in and use.
        twitter: @NaveedHIQ

        Comment


          #5
          It does, but using that camera variable with "Set View Target with Blend", I get "Camera component reference is not compatible with Actor reference".

          Comment


            #6
            Can you provide a screen shot of your 'Set View Target with Blend' inputs or the blueprint?
            twitter: @NaveedHIQ

            Comment


              #7
              Sure thing.
              Click image for larger version

Name:	Blueprint.png
Views:	1
Size:	83.7 KB
ID:	1094767
              It might not be clear in that screenshot, but the input for "Target" comes from "Get Player Controller", which ended up being covered by that tooltip.
              Last edited by Crackerjam; 12-09-2015, 12:44 PM.

              Comment


                #8
                Try setting new view target to self. It should use the actors camera component automatically (not 100% as I'm not able to try this atm).
                Last edited by Naveed; 12-09-2015, 01:08 PM.
                twitter: @NaveedHIQ

                Comment


                  #9
                  Hey, that worked! Thanks a bunch Naveed.

                  Comment


                    #10
                    Hi,
                    Sorry for digging this out but I have the exact same problem but i can't use this workaround (using self) as I have multiples cameras...

                    How can i do that ?

                    Comment


                      #11
                      I've got the same problem, it doesn't appear like Set View Target with Blend works anymore with camera components, only root camera actors.

                      Comment


                        #12
                        MagicNono mflux
                        You may have to rely on a PlayerCameraManager class and build all your camera-related blueprints in there. Spawn the PlayerCameraManager from the player controller.

                        Comment

                        Working...
                        X