Announcement

Collapse
No announcement yet.

Rotation based on surface

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

    Rotation based on surface

    So I want to rotate my character according the angle of the surface it is standing on.
    For example, if I am standing on a flat horizontal plane and move on to a +45 degree angle plane, I want the character (including camera), to then set it's new default rotation to +45 degrees.

    Would I use a line trace? And how do I set it up?


    #2
    Yeah line trace, something like from the center of the character to the ground, then break the hit results from out hit and you have the impact normal.
    My Patreon page (UE4 goodies!)

    Comment


      #3
      Edit: maybe this is what you are looking for... or something very similar...

      https://answers.unrealengine.com/sto...lowfloorbp.png
      My Patreon page (UE4 goodies!)

      Comment


        #4
        That looks as it should work.^^ Just a small comment, as it can always be seen that the "Out hit" is being taken, broken into its component and then these new outputs are actually used.
        Although that is technically of course totally working, you can also just rightclick on the "OutHit" and say "break result" there, thus having one large node less in your graph.
        Check out my GTA2 remake in UE4

        Comment


          #5
          If your Angle never goes beyond 90 degrees, you can use the CharacterMovement's "FloorHit" variable and check the Normal.
          Don't forget to set the Walking Max Angle to >90 of course.

          Comment


            #6
            Thanks all for the help.

            I have set up the image, and unfortunately it does not work.

            Key things to note here for my case:
            I am using the default third person character template. So when I use the "getActorLocation" node is it really doing what I need?
            When I set up the graph exactly as it is in the image, my character gets smashed into the ground where the trace hits, and rotates violently on the spot and I lose almost all control of it.

            Any ideas?

            Comment

            Working...
            X