Announcement

Collapse
No announcement yet.

Update character rotation control to be based on current orientation

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

    Update character rotation control to be based on current orientation

    I'm having trouble getting a helicopter accept controls based on it's current orientation vs initial orientation or world position. I have it set up currently to (I believe) grab the current controller rotation and modify in addition to that. However, the trouble is that the helicopter always recognizes the INITIAL 'forward rotation' as how it should accept controls relative to my command inputs; ie: it never turns past 90 degrees in either direction (+90/-90).

    This WAS also an issue with my position, however, I added the 'get actor forward vector' node and plugged that into the 'world direction' input of the 'add movement input' node, now position works fine. However, attempting the same strategy for the rotation has proven ineffective.

    This seems like a common problem: I've researched around for other people having this issue and tried to implement their solutions to no avail.

    I'm not sure if -- possibly my pawn is doing the rotation, but because the controller is kind of a 'child' of the pawn that I'm not updating the rotation of the correct thing? I feel like I've tried everything

    Thanks for any insight you may be able to provide!

    #2
    You need to base this on camera forward vector. So pressing up is moving torward the camera forward. I'm not home to take a screen grab of a screen of a character blue print I have doing this (Mario 64 type movment.)

    Is that what you mean thiugh? Perspective based control?
    Inphidel / Brian - Developer of Ultraball
    http://www.ultraballgame.com

    Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

    Comment


      #3
      Yes, and currently that's working for the positional location (I based it on player forward vector) -- however, I can't get that to work for rotation controls. For instance, if I turn the helicopter to the right (lets call it East) but then continue to press forward, the helicopter does travel forward (East) via position, HOWEVER it rolls to the left (North) instead of dipping forward (East). It is rolling toward what initially started as forward. It's like the rotation system isn't updating with the forward vector.

      So, actor forward vector is being used to to change the pawn world direction; however it is only effecting positional system. I can't figure where I need to be adding my initial forward vector + onto my new additional rotation input.

      Does that make sense? I appreciate the assistance! I attached what's going on for my position movement -- in case that's what's messing the rotation up.

      Click image for larger version

Name:	HeliBlueprint2.jpg
Views:	1
Size:	130.7 KB
ID:	1126263

      Comment


        #4
        Get camera manager, get forward vector for world direction is ringing a bell and right vector for move right.
        Inphidel / Brian - Developer of Ultraball
        http://www.ultraballgame.com

        Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

        Comment


          #5
          Not sure what you mean by 'right vector for move right' -- as in, I need to replace the move right with a right vector? Could you elaborate a bit, please?

          Comment


            #6
            Just replace the "get actor forward vector" by "Get Right Actor" for your MoveRight input.
            Basically :
            If your camera is following your pawn via a spring arm or something :
            You just need to get your camera then drag and pin it to Get Forward(/Right) Vector then pin it to your add input movement "World Direction".
            Or if your camera isn't following the rotation of your pawn :
            Get your pawn world rotation then follow the same logic by draging the node "Get Forward (or right) Vector" from it.
            French Game Designer - Game Designer/Prototyper
            Unreal Marketplace Assets : Options Menu Kit

            Comment


              #7
              Are you use character class for helicopter?
              There is setting called OrientRotationToMovement, which may be helpful for you.
              Rocketeer

              my portfolio
              my youtube

              Camera Volumes System
              Procedurally Instanced Meshes
              Simple Portals
              Water Flow For UDK
              Setup Swarm

              Comment


                #8
                Originally posted by Crysux View Post
                Just replace the "get actor forward vector" by "Get Right Actor" for your MoveRight input.
                Basically :
                If your camera is following your pawn via a spring arm or something :
                You just need to get your camera then drag and pin it to Get Forward(/Right) Vector then pin it to your add input movement "World Direction".
                Or if your camera isn't following the rotation of your pawn :
                Get your pawn world rotation then follow the same logic by draging the node "Get Forward (or right) Vector" from it.
                Hold the phone you just reminded me.

                If you get the spring arms relative rotation and then the forward vector and right vector etc from that. You get the correct orientation to then use against your add movements
                Inphidel / Brian - Developer of Ultraball
                http://www.ultraballgame.com

                Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                Comment


                  #9
                  Or might be world rotation.

                  Basically think of it this way you want pressing up on a stick to match the point of view. So if the spring arm is facing the character pressing up should move forward based on the camera and the right vector for strafing based on the direction. No matter how the character is turned or facing
                  Inphidel / Brian - Developer of Ultraball
                  http://www.ultraballgame.com

                  Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                  Comment

                  Working...
                  X