Announcement

Collapse
No announcement yet.

Rotate Pawn to match its speed vector?

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

    Rotate Pawn to match its speed vector?

    How do I rotate physics based pawn to match its speed?

    #2
    Do you mean you want to change the rotation rate? Can you elaborate a bit please?

    Cheers,
    Michael
    VFX & AI
    http://www.team-imx.com

    Comment


      #3
      I need a way that makes my pawn always face forward when it moves.
      In math terms pawn should always have same forward vector as its velocity vector.
      Or rotate pawn when i only have vector not rotator.

      PS:
      up direction is always up for pawn, I know i could use sin and cosinus to get it, but there must be way with vectors.
      arc tangents works just fine but there must be better solution.
      Last edited by Nawrot; 05-04-2014, 07:13 PM.

      Comment


        #4
        I'm not sure I understand your question. You want to rotate your pawn in order to face directly in same direction as the velocity?
        If so then I think you can get the rotation you want by plugging the velocity vector to a "Rotation from XVector" node.

        4.10 Update! -> [Community Project] WIP Weather & Ocean Water Shader
        WIP Interactive Water Shader, WIP 2D Water Sim
        WIP FFT Ocean w/ Foam, Quad-tree Infinite Ocean LOD

        Comment


          #5
          I solved it with atan function. x/y= rotation (or other way around).

          I am making sea ship pawn that behaves like ship, ie. it cannot rotate freely it is always rotated in same direction as its speed vector.
          Unlike most ships in examples that have kind of space ship movement without friction for rotating.

          All those rotation from vector nodes work in 3d space. My ship moves in 2d space.

          Now only one thing left is rotating when velocity is close to zero, but that will be a matter of turning off rudder thruster when speed is less than 20 or so.

          Comment


            #6
            Originally posted by Nawrot View Post
            I solved it with atan function. x/y= rotation (or other way around).

            I am making sea ship pawn that behaves like ship, ie. it cannot rotate freely it is always rotated in same direction as its speed vector.
            Unlike most ships in examples that have kind of space ship movement without friction for rotating.

            All those rotation from vector nodes work in 3d space. My ship moves in 2d space.

            Now only one thing left is rotating when velocity is close to zero, but that will be a matter of turning off rudder thruster when speed is less than 20 or so.
            Can you explain a little more because I'm having the same situation here and, if you don't mind, I would like you to explain the logic behind it so I can understand for making my own stuff.

            I'm using BP, BTW.

            Comment


              #7
              Originally posted by TK-Master View Post
              I'm not sure I understand your question. You want to rotate your pawn in order to face directly in same direction as the velocity?
              If so then I think you can get the rotation you want by plugging the velocity vector to a "Rotation from XVector" node.
              your solution Nailed it! I had no clue how it would work, but plugged it in as you said and voila! perfect! Thank You!

              Comment

              Working...
              X