Announcement

Collapse
No announcement yet.

Third Person Camera character head bone look at cursor

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

    Third Person Camera character head bone look at cursor

    I'm looking for a way to control the head of my third person character using the mouse, so where ever the mouse is looking at, the character looks at while maintaining its original orientation.

    I've looked around and all the tutorials I've looked at is where the mouse controls the entire character, but I'm looking to rotate just the head bone "Biped001Head"
    I would like to put a limiter on this since I don't want my characters neck to break when I move the mouse camera behind to look behind the character. (Maybe 60 degrees left and right)

    Finally I would like to add in a delay system so when the mouse moves, the head waits a little and then turns to follow the mouse.

    At the moment all I've found is a node in the AnimGraph called "Transform (Modify) Bone" where I can control rotation...well it definitely looks like it , but I don't know where to go from there



    UE4 is a great engine!
    and I'm alone using this

    #2
    I decided to give it a go with what I had.
    I was able to figure out how to control the bone with the mouse but the turning is bonkers.
    When the character is facing forward, the mouse works fine, but whenever im on the threshold of the mouse boundaries
    (mouse is on the right side of the screen moving to the left)
    the head just snaps without any blending

    Click image for larger version

Name:	adasdsdwq2.jpg
Views:	1
Size:	144.4 KB
ID:	1057498



    When I turn the character to face the other way, the turning goes inverted so I was able to make some small progress but missed out on something crucial

    Click image for larger version

Name:	0af1039ffe3bdbc49b319ccd687647c6.png
Views:	1
Size:	122.5 KB
ID:	1057499
    Click image for larger version

Name:	1bf5a59849ea30a96facfe3bb2cc4107.png
Views:	1
Size:	153.3 KB
ID:	1057500


    Help is appreciated,
    thank you

    Comment


      #3
      I think using an aimoffset would be better than trying to control the individual bone. Aimoffset is used in the animation content example to make the controllable pawn aim where the camera is looking, but you could make reference animations with just the head moving instead of the entire body and then use a layered blend per bone with the neck as the beginning of the blend.

      Use interpolation to smooth out movements, the node is called rinterp to. Get delta time from your event update animation, read the current value of the rotation, the new calculated value of the rotation should be the target and then set the return value as the current value. The example below is for getting where the third person camera is looking and limiting the angle to between -90 and 90 so that it can be used with an aimoffset asset.


      Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	110.1 KB
ID:	1057501

      Comment


        #4
        Thanks, heaps, I didn't think of it cause i was so narrow minded, but animsets do sound more promising.
        I'll give it a go and post my progress!
        Thanks

        Comment

        Working...
        X