Announcement

Collapse
No announcement yet.

Setting Pawn Rotation to Match the Floor

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

    Setting Pawn Rotation to Match the Floor

    Hi there, so I'm working on setting up a hovering vehicle which is all working rather well so far. My issue is that the roll and pitch of my vehicle are locked by default I guess. What I need to do is set up the blueprint to allow the vehicle's pitch and roll to adjust to the changing terrain. As far as sticking to surfaces upside-down, I'll figure that out later. Thanks for your time!

    #2
    Hi, you could try taking that rotation you have, converting to XVector, then getting the surface normal of the ground under the vehicle (do a trace down and get the hit normal), adding that vector to the actors XVector, then converting back from Xvector to Rotator and updating your vehicle rotation with that.

    I may have missed a step and you may want to not use the whole strength of the underlying normal, or even do a time lag blend to it using some kind of moving average. I hope my idea works, if not let me know.
    Ryan Brucks
    Principal Technical Artist, Epic Games

    Comment


      #3
      I did this before for a tank game I was tinkering with.

      http://i.imgur.com/uUwOOI4.jpg
      Attached Files

      Comment


        #4
        @Enos Shenk - Dude i cant thank you enough for that! helped me out so much

        Comment


          #5
          thanks for this, I was using make rotate from z and it worked for going up hills but not when you started to go down them. I understand now why you have to put the right vector in.
          My website: www.jaspercousins.co.uk

          Comment


            #6
            Enos Shenk > Thanks you ! It works very well !

            Comment


              #7
              awesome thanks for this!

              Comment


                #8
                Originally posted by Enos Shenk View Post
                I did this before for a tank game I was tinkering with.

                http://i.imgur.com/uUwOOI4.jpg

                Awesome Enos Shenk. Thanks!

                Comment


                  #9
                  Originally posted by Enos Shenk View Post
                  I did this before for a tank game I was tinkering with.

                  http://i.imgur.com/uUwOOI4.jpg
                  you rock Enos! thanks!
                  Enigma Prison - Facebook - Twitter - IndieDB

                  Comment


                    #10
                    Originally posted by Enos Shenk View Post
                    I did this before for a tank game I was tinkering with.

                    http://i.imgur.com/uUwOOI4.jpg
                    Where about does the "LineTraceForObjects" link up to on the left, and the "RInterp" near the end link up to, got no idea where to put them

                    Comment


                      #11
                      Thank you! Works really great for my little crab dude!

                      Comment


                        #12
                        Originally posted by Enos Shenk View Post
                        I did this before for a tank game I was tinkering with.

                        http://i.imgur.com/uUwOOI4.jpg
                        you are my god !!

                        Comment

                        Working...
                        X