Announcement

Collapse
No announcement yet.

Rotating pawn with camera pitch/yaw/roll movement?

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

    Rotating pawn with camera pitch/yaw/roll movement?

    After having attempted to get this working for a while now I'm really stuck. Updating original question to something shorter:

    Does anyone know how to locally rotate the player (collision volume + camera) relative to pitch/roll/yaw movement output?

    Edit: The question is a little bit confusing. Basically I would like to rotate the pawn mesh to wherever my camera is facing. So that I don't jump upwards based on world position if my camera is upside-down. So I want to constrain the pawn mesh rotation to the camera. Right now if I turn my camera upside-down the yaw is inverted because the mesh is still oriented upright (?)

    Hi,

    New to these forums but former UDK indie dev. Happy to be around the scene again! I'm having a small problem at the moment:

    I am attempting to rotate the pawn in my scene based on yaw/pitch/roll movement.

    As I change pitch, yaw or roll to turn my camera upside-down it makes mouse movement inverted. I.E. dragging cursor to the left moves camera to the right vice versa.

    I feel like the pawn needs to rotate along with my camera rotation when performing pitch/yaw/roll but I'm not sure how to set it up (blueprint).

    I am building a flying environment in first person view and I am trying to make sure that movement when upside-down still maintains 'expected' rotational direction (i.e. not inverted when upside down). Imagine that when I turn my plane upside down and I drag my mouse to the left, the plane goes right instead, which is not desired. I would like the plane to move in the direction of my sideways mouse input both up-right and upside-down.

    Any help would be appreciated. Let me know if you need additional information.

    Thank you!
    Last edited by Verilion; 08-04-2014, 01:18 AM.

    #2
    Attached link to video to describe the problem!

    https://app.box.com/s/zu5x6anjgv2jdwp1iz53

    Comment


      #3
      6 hours later.

      Bumping just this once - simplified the question so that people don't have to read a giant wall of text. I've been trying a lot of stuff and I'm pretty stumped at this point.
      Last edited by Verilion; 08-04-2014, 01:18 AM.

      Comment


        #4
        When your getting the Forward, Right and Up vectors you should be getting that of the camera instead of the player actor itself. That way you'll all ways move based on where the camera is facing. Hope this helps.
        Check out my pet project: Salvos - Maze Survival

        Looking for blueprint tutorials? Then visit my blog or YouTube channel.
        Blog: voxagon Youtube: Click

        Comment


          #5
          Originally posted by pattym View Post
          When your getting the Forward, Right and Up vectors you should be getting that of the camera instead of the player actor itself. That way you'll all ways move based on where the camera is facing. Hope this helps.
          You're right that would make it much easier. However, I was not able to figure out where to fetch the camera actor from. Plus, what I want to do is to actually rotate the actor along with the camera... here is my setup:

          Click image for larger version

Name:	thecondition.jpg
Views:	1
Size:	428.7 KB
ID:	1053222

          Comment


            #6
            i am on my tablet, so I keep this short.

            The key is to apply rotation around your root axis. If you have cam attached to that root, it will rotate with it.

            i see that you use AddControlInput, but think those functions dont really do that. I might be wrong on this, but I think that those functions always assume that your character is Z-up.

            To fix that, you'd have to replace them with your own ones, that always rotate around the current Forward-, Up- and RightVector.

            *edit: https://wiki.unrealengine.com/Blueprint_Six-DOF_Flying_Pawn_Tutorial

            This might help you
            Last edited by DennyR; 08-05-2014, 06:02 AM.

            Comment


              #7
              Originally posted by DennyR View Post
              i am on my tablet, so I keep this short.

              The key is to apply rotation around your root axis. If you have cam attached to that root, it will rotate with it.

              i see that you use AddControlInput, but think those functions dont really do that. I might be wrong on this, but I think that those functions always assume that your character is Z-up.

              To fix that, you'd have to replace them with your own ones, that always rotate around the current Forward-, Up- and RightVector.

              *edit: https://wiki.unrealengine.com/Bluepr..._Pawn_Tutorial

              This might help you
              Hey, thanks for the reply.

              I tried doing this by reworking the flying pawn blueprint yesterday. The movement is correct, however the new problem becomes that my pawn completely stops in world space whenever I release my inputs (W, A, S, D). I would like it to maintain some velocity and slowly slow down to a stop. Maybe I should start a new thread for that? Unless you know a good solution to this. Thanks!

              Here is a video from the first Crysis game showing what I want to do:
              https://www.youtube.com/watch?v=OuWJJWEgVJI#t=41

              If the video doesn't take you to the right place it's 40 seconds in.

              You can hear that he's pressing the W key to go forward (there is a faint gas audio sound when it is pressed) and the speed is dampened as he releases the input.
              I guess I will need to set up an acceleration logic for this.

              Click image for larger version

Name:	transform.jpg
Views:	1
Size:	430.2 KB
ID:	1053225

              Otherwise this thread is solved. Thanks for the help guys .
              Last edited by Verilion; 08-05-2014, 06:16 AM.

              Comment


                #8
                Originally posted by Verilion View Post
                Hey, thanks for the reply.

                I tried doing this by reworking the flying pawn blueprint yesterday. The movement is correct, however the new problem becomes that my pawn completely stops in world space whenever I release my inputs (W, A, S, D). I would like it to maintain some velocity and slowly slow down to a stop. Maybe I should start a new thread for that? Unless you know a good solution to this. Thanks!

                Here is a video from the first Crysis game showing what I want to do:
                https://www.youtube.com/watch?v=OuWJJWEgVJI#t=41

                If the video doesn't take you to the right place it's 40 seconds in.

                You can hear that he's pressing the W key to go forward (there is a faint gas audio sound when it is pressed) and the speed is dampened as he releases the input.
                I guess I will need to set up an acceleration logic for this.

                [ATTACH=CONFIG]8178[/ATTACH]

                Otherwise this thread is solved. Thanks for the help guys .

                Not sure if you are still looking into this but if you use this guide for the forward backward motion and use yours for the rotation should work.

                https://wiki.unrealengine.com/Bluepr...OF_Flying_Pawn

                Comment

                Working...
                X