Announcement

Collapse
No announcement yet.

Possessing a Pawn? FPS blueprint to Flying blueprint

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

    Possessing a Pawn? FPS blueprint to Flying blueprint

    Hi,

    I have been trying to figure this out for quite awhile and still can't figure out how it is done. How do you go from controlling an FPS pawn to controlling a Flying pawn? I have been successful in possessing the pawn but I can't get the controls to work for said pawn. If I switch from the FPS pawn to the Flying pawn, the Flying pawns controls won't work.

    Basically I have been wondering how to bring in two different blueprint templates and get them to work nice with each other. Can someone please explain or direct me to a good tutorial that can answer my issue? Thanks!

    #2
    You should put the controls in the PlayerController, not the Pawn. If the Pawn looks for any input event, remove it from there, and put it into the controller.

    Now, when the PlayerController knows what kind of pawn it controls, it can translate the input as appropriate to the given pawn.

    Comment


      #3
      Originally posted by jwatte View Post
      You should put the controls in the PlayerController, not the Pawn. If the Pawn looks for any input event, remove it from there, and put it into the controller.

      Now, when the PlayerController knows what kind of pawn it controls, it can translate the input as appropriate to the given pawn.
      Thanks for the answer! How would I go about doing that if I have two different game types (FPS and Flying)? Sorry, just a bit lost.

      Comment


        #4
        Game Types are nothing that Unreal Engine knows about. It's just a very shallow set of initial configuration for the default pawn and controllers being created in the different template projects.

        I suggest you create one of each of the templates, and open up the blueprints for the game mode, pawn, and player controllers for each of them, and poke around and read through the implementation until you understand how they are put together.

        Then it should be easy to move around the bits that you need!

        Comment


          #5
          Originally posted by bigboy2k View Post
          Thanks for the answer! How would I go about doing that if I have two different game types (FPS and Flying)? Sorry, just a bit lost.
          Don't follow that advice.

          If you have multiple different Pawns, that don't share the same Input/Movement logic, give EACH Pawn their own Input.

          The PlayerController only needs Inputs, which need to be valid during Pawn change or when you don't have a pawn (opening menu for example).

          So it's better to leave the Input in your Flying Pawn and fix the issues that come up.

          First step for this would be sharing screenshots of the involved Blueprints (:
          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


            #6
            Originally posted by eXi View Post
            Don't follow that advice.

            If you have multiple different Pawns, that don't share the same Input/Movement logic, give EACH Pawn their own Input.

            The PlayerController only needs Inputs, which need to be valid during Pawn change or when you don't have a pawn (opening menu for example).

            So it's better to leave the Input in your Flying Pawn and fix the issues that come up.

            First step for this would be sharing screenshots of the involved Blueprints (:
            Thanks! I created a new player controller and this is what my blueprint looks like. I am trying to switch from FPS to Vehicle.

            Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	116.5 KB
ID:	1108236

            The problem I am having now is that the key input won't work. Do you know why that is? Oh and I did check if "block input" was enabled and it wasn't.

            Comment


              #7
              Does anyone know why my input keys are not working? I press them but they do nothing. Thanks!

              Comment


                #8
                The PlayerController only needs Inputs, which need to be valid during Pawn change or when you don't have a pawn
                My experience is that, for games that might be networked, you really do want PlayerController to have the input authority. And thus, that's good practice to build in all cases.

                Comment


                  #9
                  Originally posted by jwatte View Post
                  My experience is that, for games that might be networked, you really do want PlayerController to have the input authority. And thus, that's good practice to build in all cases.
                  Thanks but do you know why the inputs are not working? I was following along to a tutorial and they worked fine on the tutorial but when I do them the inputs don't work. This makes it so I can't switch between FPS and vehicle.

                  The tutorial I was following is here:

                  https://www.youtube.com/watch?v=UXFl_yWQjLs
                  Last edited by bigboy2k; 06-14-2016, 02:50 PM.

                  Comment


                    #10
                    Is it only NOT working in the Vehicle? What happens if you switch back? Does the original Pawn work?
                    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


                      #11
                      Originally posted by eXi View Post
                      Is it only NOT working in the Vehicle? What happens if you switch back? Does the original Pawn work?
                      The inputs don't work at all. I press the buttons and nothing happens. I created the inputs in a player controller that I made and did as the tutorial says but when I press "1" to switch to the vehicle nothing happens. Do I need to create a blueprint for the level that calls on the player controller that I made?

                      Comment


                        #12
                        Waaaaait, you can't even possess the Pawns? Do you have them Spawned in the Level?
                        Do you get an error when pressing 1 or 2?
                        Have you tried putting a "Print String" node behind each to test if they work at all?
                        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


                          #13
                          Yeah, I can't even possess the pawns. They are spawned in the level and I get no errors. I watch my player controller blueprint when I press one of the numbers and nothing happens that shows the numbers were even pressed. I just don't get what I am doing wrong when I followed the tutorial exactly

                          Comment


                            #14
                            Originally posted by bigboy2k View Post
                            Yeah, I can't even possess the pawns. They are spawned in the level and I get no errors. I watch my player controller blueprint when I press one of the numbers and nothing happens that shows the numbers were even pressed. I just don't get what I am doing wrong when I followed the tutorial exactly
                            But you actually setup a new Custom GameMode and entered your Custom PlayerController into it?
                            And you also set the GameMode of your map to your Custom GameMode?

                            Because it sounds like the PlayerController isn't even setup to be used.
                            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


                              #15
                              Originally posted by eXi View Post
                              But you actually setup a new Custom GameMode and entered your Custom PlayerController into it?
                              And you also set the GameMode of your map to your Custom GameMode?

                              Because it sounds like the PlayerController isn't even setup to be used.
                              I feel so stupid because that was the problem. I forgot to setup my own Custom GameMode and once I did it, BAM it worked! Thanks so much for helping me with this

                              Comment

                              Working...
                              X