Announcement

Collapse
No announcement yet.

Why do I have 2 cameras and 2 player Controller???

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

    Why do I have 2 cameras and 2 player Controller???

    Hi everyone,

    I have a camera actor blueprint in my scene that I use to follow the player or any other target in the map. I also have a blueprint/C++ player controller. But when I press play, there's a second camera actor and player controller that appears. It's not being used or anything. But it's quite annoying not knowing why!

    Click image for larger version

Name:	Image 1.png
Views:	1
Size:	63.3 KB
ID:	1155023
    The Hangar Studio - Video Game Studio

    An I for an I
    (Imagination equals Innovation)

    #2
    Hello,

    From what I understand you are using the pawn system, in addition to placing your character and camera manually. Without more information, I can not say for sure, but if this is the case your World Settings->Default Pawn is causing the spawner to spawn the default pawn in addition to the manually placed one. Same deal if you are spawning by code.

    Comment


      #3
      In my scene, I only place a player start object. But thanks for the info, I will look into it.

      The Hangar Studio - Video Game Studio

      An I for an I
      (Imagination equals Innovation)

      Comment


        #4
        Originally posted by maparizeau View Post
        In my scene, I only place a player start object. But thanks for the info, I will look into it.

        Are you doing any extra instantiation through Blueprint or C++?

        Comment


          #5
          So this is what I have in my world settings

          Click image for larger version

Name:	Image 2.png
Views:	1
Size:	43.6 KB
ID:	1081275

          and this is what I have in my game mode cpp file.

          Click image for larger version

Name:	Image 3.png
Views:	1
Size:	26.4 KB
ID:	1081276

          I still don't understand why this is happening. As far as the camera goes, I don't understand why there's 2 of them. Is there a place where I can tell him to only use my custom camera?
          The Hangar Studio - Video Game Studio

          An I for an I
          (Imagination equals Innovation)

          Comment


            #6
            Uhm, i am really not sure if i got this right.

            You have a PlayerPawn/Character that derives from PlayerController? Is that even possible? Guess this was just a typo?

            Other than that everything is perfectly ok from my POV. When you start the game, the engine looks for a playerstart and
            - Spawns the character that you specified as DefaultPawn (which is the BP_Characters)
            - Spawns a PlayerController as specified in the Default Settings (which is PlayerController)
            - Spawns a camera that is defined somewhere in the Pawn maybe?

            Did you actually put the Camera and BP_Characters manually into the level? This usually wont work with a playerstart actor, since with a PlayerStart everything is spawned on-demand and will always use the newly spawned classes for the actual game.

            If you want to use your character and camera that you put manually into the level you cant really use a playerstart but would have to code custom stuff for that to happen.

            Cheers,
            Indy
            FinalCamera on Marketplace / Web Demo
            TopDown Toolkit on Marketplace / Web Demo

            Comment


              #7


              This picture is not showing 2 Controllers. It is showing 1 PlayerCHARACTER and 1 PlayerCONTROLLER.

              The camera could come from the BP_Character. Check if he has a Camera in his components.

              So far, everything is correct. You simply misstook the Character for a Controller.

              EDIT: Also this can't be:



              If the Pawn would derive from a Controller, you couldn't set it as a Pawn. The DefaultPawn is a APawn* pointer.
              It won't accept a controller. I get the feeling that you have no idea what a Controller is. Controller is not the same
              as a Character/Pawn. The Controller CONTROLS the Pawn. It is the bridge between the Human Player and the Character.
              Each Human Player (in a multiplayer) has only one PlayerController. In singleplayer you also only have 1.

              It is ALWAYS spawned. With a PlayerController, the whole Engine Framework wouldn't work.

              A Character/Pawn on the other Hand doesn't need to exist. But if you have no Pawn/Character, you have nothing to possess
              and control by the Controller.
              Last edited by eXi; 07-07-2015, 10:08 AM.
              Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

              My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
              (Including 100+ Pages Multiplayer Network Compendium to get you started.)

              Comment


                #8
                Hi eXi,

                Thanks for the info. I think as well that I am missing info and mixing things up thus the reason I was asking the question. I will read a bit more before I go further into my game just to make sure that I have everything setup properly.

                Thanks again

                Originally posted by indygoof View Post
                Uhm, i am really not sure if i got this right.

                You have a PlayerPawn/Character that derives from PlayerController? Is that even possible? Guess this was just a typo?

                Other than that everything is perfectly ok from my POV. When you start the game, the engine looks for a playerstart and
                - Spawns the character that you specified as DefaultPawn (which is the BP_Characters)
                - Spawns a PlayerController as specified in the Default Settings (which is PlayerController)
                - Spawns a camera that is defined somewhere in the Pawn maybe?

                Did you actually put the Camera and BP_Characters manually into the level? This usually wont work with a playerstart actor, since with a PlayerStart everything is spawned on-demand and will always use the newly spawned classes for the actual game.

                If you want to use your character and camera that you put manually into the level you cant really use a playerstart but would have to code custom stuff for that to happen.

                Cheers,
                Indy
                thanks for the the info. as with eXi, this info will help me understand better the way it works. In "real life", I work in QA so I think it's just my QA side coming out and asking all of these question to make sure that I understand what is going on and if I don't, so that people like you and the community here can put me back on the right track.

                thanks a lot
                Last edited by eXi; 07-07-2015, 11:09 AM.
                The Hangar Studio - Video Game Studio

                An I for an I
                (Imagination equals Innovation)

                Comment


                  #9
                  Always glad to help. Please read the documentation about the GameFramework to better understand the classes:

                  https://docs.unrealengine.com/latest...nce/index.html

                  And here are the overall Gameplay Docs (the one above is only the Framework Quickguide):

                  https://docs.unrealengine.com/latest...lay/index.html
                  Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

                  My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
                  (Including 100+ Pages Multiplayer Network Compendium to get you started.)

                  Comment


                    #10
                    Wow thank you, I will read them. Always on board when it's time to learn something... properly loll
                    The Hangar Studio - Video Game Studio

                    An I for an I
                    (Imagination equals Innovation)

                    Comment

                    Working...
                    X