Announcement

Collapse
No announcement yet.

How to make a "Third person character's" arm point in the direction of the camera?

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

    How to make a "Third person character's" arm point in the direction of the camera?

    Hey all,

    So I'm using a Third Person character setup to create a full body First Person perspective. IE I started with a Third Person Character and then attached the camera to the Head bone of the skeleton.

    I've got a Flashlight setup in my anim blueprint using an animation montage for "Draw, Idle and Holster" connected to my character bp so when the player hits the L key, the flash light draws then turns on. This looks great but the problem is the light is always shining straight forward regardless of which direction the player looks. I tried parenting the spot light component to the camera but it just doesn't look right because it's obvious that it's not emanating from the flashlight in the characters hand. Is there a simple(ish) way to have the character's arm point in the direction the camera is facing so I can get the best of both worlds here? I'm guessing the answer might be using an blend space but I've only ever set up a 1D Blendspace so I'm not really sure how those work. Is there another way to do this or is the blend space my best option?

    Here's a screenshot of my setup:



    Incase you're wondering why the character's face is blurred out, it's a secret for my game so I don't want an image of his face to exist anywhere on the internet.
    Last edited by TorQueMoD; 07-08-2017, 03:56 AM.
    -TorQueMoD
    www.torquemod.com

    #2
    So I found a tutorial on how to use "Transform (Modify) Bone and add some rotation to the arm to match the camera's direction. Unfortunately it's not quite working properly as everything is off by 45 degrees so when you look at the ground, the arm is forward, when you look forward it's up 45 and when you look up it's almost behind you. Any idea how to fix this?

    Here's my event graph:
    -TorQueMoD
    www.torquemod.com

    Comment


      #3
      Anyone have any ideas as to why the rotation of the arm is off and how to fix it?
      -TorQueMoD
      www.torquemod.com

      Comment


        #4
        what is the purpose of the /2 node? What happens if you disconnect it? and what happens if subtract or add 90 to X instead of dividing by 2?

        Comment


          #5
          The divide by 2 node was there simply because I was following a tutorial and that's what he did. To be honest I'm not sure if it's helpful in my setup because I'm trying to rotate the arm not the head (as in the tutorial). If it's off by 45 degrees, why would I add or subtract 90? Or is that just to get an exaggerated result for testing?
          -TorQueMoD
          www.torquemod.com

          Comment


            #6
            If you divide by 2 it could be that your arm is actually 90 degrees off. Subtracting 90 or adding 90 could potentially be a fix for that depending on the original rotation. Working off the thirdperson template, in my setup I have both subtracting 90 and adding 90 to roll and yaw to make it face my camera direction correctly

            Comment


              #7
              Ok cool. Thanks for that. I'm just working on another area of the game at the moment but I'll try getting rid of the divide and using the add and subtract to see if that works better and post the results when I've finished.
              -TorQueMoD
              www.torquemod.com

              Comment


                #8
                I don't wanna sound like a necromancer but this was the first hit on Google.
                TorQueMoD
                Any news or success on this? Where did you find the tutorial?

                Cheers!

                Comment


                  #9
                  Sadly no. I've since developed a completely new method for doing a true first-person character which is an amalgamation of a traditional first-person with the lower half of the body rendered below and behind the camera and a Third person/shadow mesh that follows all of the movements. It's a lot more of a process to set up but it's also a lot easier to work with in terms of getting your animations put together. Sadly, I was too far into my current project to go through the process of using my new design for it so I've just given up on trying to get this working. I'd love an answer if anyone has one but I may come back to this later. Likely the setup works, it's just the math is off. I'm guessing you'd need to specify a different amount for the min/max in the clamp in my example.
                  Last edited by TorQueMoD; 04-18-2020, 06:01 AM.
                  -TorQueMoD
                  www.torquemod.com

                  Comment


                    #10
                    It seems like I had a working version of this. Unfortunately I don't think I have the project anymore BUT I am working on something new with this mechanic so once I get to it I'll be back!

                    Comment


                      #11
                      Assuming a standard setup up all you had to do was place an IK bone into the correct camera driven position, and then use any of the IK solvers with a variable alpha.

                      Try something similar to this, but move the IK bone, then have the solver address it.
                      https://www.youtube.com/watch?v=FGtEsZ3_JgE

                      Also, for a proper first person view, perhaps you'd have been better off with an aim offset, especially if the flashlight is one handed.
                      For that, all you do is pop out single frame animations of the various angles from a DCC just like the aim offset. same idea - and it would work quite the same, possibly much better then IK.

                      Comment


                        #12
                        Originally posted by MostHost LA View Post
                        Assuming a standard setup up all you had to do was place an IK bone into the correct camera driven position, and then use any of the IK solvers with a variable alpha.

                        Try something similar to this, but move the IK bone, then have the solver address it.
                        https://www.youtube.com/watch?v=FGtEsZ3_JgE

                        Also, for a proper first person view, perhaps you'd have been better off with an aim offset, especially if the flashlight is one handed.
                        For that, all you do is pop out single frame animations of the various angles from a DCC just like the aim offset. same idea - and it would work quite the same, possibly much better then IK.
                        Yeah, using an aim offset is what I did for the new method of a "true first person". Do aim offsets work with a third person character though? It's been so long since I dropped this that I can't remember exactly how they work. Aim offsets are essentially adjusting the third person animations to match the rotation of the camera, aren't they? That could be perfect.
                        -TorQueMoD
                        www.torquemod.com

                        Comment


                          #13
                          They work fine in 3rd person. They are unusually useful as aim offsets but it's the same theory.

                          You can even combine the 2 imethofs n order to get a better adjusted animation...

                          Comment

                          Working...
                          X