Unreal Engine 4 - True First/Third-Person Character [Tutorial + Download]

preview_player
Показать описание
Hey. In this quick tutorial, I am going to teach you how to create a True First Person Character using Unreal Engine 4. The character will lean properly to follow the players' camera movements, as well as playing proper turn animations.
This works well for First-Person and Third-Person games

Like if you enjoyed! Subscribe for more!

Ask me anything in the comments.

0:00 Introduction
0:46 Start with third person character template
1:03 Move and adjust the camera in the character
1:56 Demonstration of issue of seeing into your own body
2:05 Edit the animation blueprint, get control rotation
2:21 Create function GetLookRotation and set inputs and outputs
2:48 Transform the look target roration to match the coordinate system of the default character
3:11 Interpolate the head rotation towards the control rotation and use it as output
3:42 Call the function and actually update the value of the head rotation variable
4:00 Apply the value of the head rotation variable to the bones in the animation graph
4:45 Demonstration of issue of upper body being shown in weird direction and bend unnaturally
4:50 Reduce the rotation of the spines and neck to 15% and the head to 40% (sums up to 100% for the head)
5:23 Demonstration of more natural bending but still in a weird direction (in the preview)
5:26 Set default value for head rotation variable to fix the direction in the preview
5:33 Demonstration: No more looking into own body, but issue that player is not turning with the camera and the camera snaps to the other side
5:48 Choose and download turn animations from mixamo
6:46 Import animations
7:46 Setup downloaded skeleton for retargeting
8:31 Setup the unreal default mannequin skeleton for retargeting
8:39 ADDITIONAL STEP NEEDED (not in video): Your skeleton probably lacks a preview mesh which is needed for retargeting. Add them for the new (and if needed the old) skeleton:
* Open skeleton asset
* Click preview mesh
* Click on a mesh. The message will appear and the bottom right: “This mesh is set temporarily…”
* Click apply under the message
* Save skeleton
8:39 Retarget
8:51 Move character down if it is floating using a key for the pelvis
9:06 Add animation states for turning
9:30 Add boolean variables to control the transitions
9:45 Transition back to idle if one animation cycle is done or if the character is moving
10:11 Activate the turning animation by setting the new turn transition control variables if camera looks more than 90° to left or right
11:06 Rotate the character and let the animation play for one second, then set turn variables back to false to transition back to idle
11:24 Add notifications near the end of the turning animations
11:44 On notification set the turn transition control variables back to false to transition back to idle
12:02 Demonstration that the character is turning with the camera and the turning animation is played
12:23 Limitation
Рекомендации по теме
Комментарии
Автор

I seriously cannot thank you enough, this tutorial is amazing was able to get everything working in 5.0.3 and it didn't even take that long.

If anyone is trying to follow along in UE5, the players feet dont move because of the new foot IK control rig in the anim bp, you can fix this by just setting the transform of the foot ik bones to the transform of the actual feet bones in the start of the control rig (theres a unreal forum post that shows an image of how to do this). This fixes it because the IK feet controllers dont follow the retargeted animations in UE5

It's also easy to fix the side strafing and walking backwards issues by just changing the anim blueprint with new anim states for directional animations (I used more from mixamo) and turning off orient to direction except when walking forwards

CrazyBloo
Автор

I searched for "first person with body unreal".

This is first on the list. Exactly what I was looking for.

Thank you and have a great day.

wmka
Автор

Crazy tutorial. Much simpler than the rest, much faster, much better. Im amazed.

arosinek
Автор

Thanks a million for the tutorial! I've enjoyed it. The head being offset worked for me by changing the values from ThirdPerson_AnimBP the two values after Float. First multiplication set to -0.25 and second multiplication to -0.4

markusbronst
Автор

This tutorial was a blast! I found it a bit hard to follow in some parts (I'm not new to Unreal but I haven't messed a lot with animations), but absolutely worth the time. I will tweak some things for sure, since the character rotates in place but no animation, it jitters while rotating. I learnt a lot in a record time, so thanks a lot :)

javierfernandez
Автор

You are a legend! I learned in 14 min more than 4 years in the university... (in UK). Many tanks!

szilardpop
Автор

0:00 Introduction
0:46 Start with third person character template
1:03 Move and adjust the camera in the character
1:56 Demonstration of issue of seeing into your own body
2:05 Edit the animation blueprint, get control rotation
2:21 Create function GetLookRotation and set inputs and outputs
2:48 Transform the look target roration to match the coordinate system of the default character
3:11 Interpolate the head rotation towards the control rotation and use it as output
3:42 Call the function and actually update the value of the head rotation variable
4:00 Apply the value of the head rotation variable to the bones in the animation graph
4:45 Demonstration of issue of upper body being shown in weird direction and bend unnaturally
4:50 Reduce the rotation of the spines and neck to 15% and the head to 40% (sums up to 100% for the head)
5:23 Demonstration of more natural bending but still in a weird direction (in the preview)
5:26 Set default value for head rotation variable to fix the direction in the preview
5:33 Demonstration: No more looking into own body, but issue that player is not turning with the camera and the camera snaps to the other side
5:48 Choose and download turn animations from mixamo
6:46 Import animations
7:46 Setup downloaded skeleton for retargeting
8:31 Setup the unreal default mannequin skeleton for retargeting
8:39 ADDITIONAL STEP NEEDED (not in video): Your skeleton probably lacks a preview mesh which is needed for retargeting. Add them for the new (and if needed the old) skeleton:
* Open skeleton asset
* Click preview mesh
* Click on a mesh. The message will appear and the bottom right: “This mesh is set temporarily…”
* Click apply under the message
* Save skeleton
8:39 Retarget
8:51 Move character down if it is floating using a key for the pelvis
9:06 Add animation states for turning
9:30 Add boolean variables to control the transitions
9:45 Transition back to idle if one animation cycle is done or if the character is moving
10:11 Activate the turning animation by setting the new turn transition control variables if camera looks more than 90° to left or right
11:06 Rotate the character and let the animation play for one second, then set turn variables back to false to transition back to idle
11:24 Add notifications near the end of the turning animations
11:44 On notification set the turn transition control variables back to false to transition back to idle
12:02 Demonstration that the character is turning with the camera and the turning animation is played
12:23 Limitation

PaulPaulPaulson
Автор

i have a problem, when i play in multiplayer it doesnt work, i tried with 2 players and when i play with one character, the other character head rotation stays the same as my rotation and looks where iam looking and not where he is looking, can you please help?

bercouli
Автор

You are the hero. Clear explanation of what you are doing without water in the text. Thank you so much man.

betraid
Автор

Great vid man, I like your idea of morphing the bones instead of just hiding the bones. Im not a big fan of socketing the head for fps as I personally hate headbob but I guess you could just isolate the heads animations and try to make it still, course this could be an issue if you have a lot of different movement states but is doable. +1 sub and looking forward to more content I always love to see how other people do stuff and try to mix it with my own or improve on my own in some way. One of the best parts of coding is the amount of ways you can achieve the same affect so its always good to watch other ideas.

_Man_Media
Автор

you can use an finterp to node and connect the return value from the clamp node to the target input of the finterp to, connect a "get world delta seconds" node to the delta time, choose any interp speed (i use 4.0), and use any method get the current rotation of the axes of the head and plug them into the current input of the finterp to and it makes the looking a lot more smooth and natural, and fixes the weird head teleportation when you look left and right too fast.

gilbertbeardsley
Автор

Anybody else turning this 13 minute video into a 5 day long tutorial? CGsky, you talk and work so fast and I kept messing up several things, but I am also a beginner in UE4. Your 1 minute tutorial is equal to 20 minutes of me rewinding several times and fixing and figuring out what you did. I even had to watch your video in super slow-mo! D:

PhilosophicalPawn
Автор

life saver. excelent video. only one thing. it would help if you took just a little more time between every step. it started out perfect but as the video progressed you accelerated to much and it was nearly imposible to pause it fast enough to see what you were actually doing. if you take a seccond or two per script so that we can see them before you advance it would be excelent. still very nice. very helpfull. thank you

GisAnalisisCAZ
Автор

Subbed. Would love to see the follow up fixing the running turn issues

yosh_io
Автор

I am having an issue where my character doesn't complete his animation. If I look down at the ground and turn, he will snap back to facing forward even though I am looking the other direction. How does one fix this?

PhilosophicalPawn
Автор

You can fix the jittering/vibrating body when turning by changing both Z values in AddActorLocalRotation from -5 to -1 and 5 to 1. However this True FPS have a lot of other issues which is understandable since it is covered in 13 minutes :D Thanks for the tutorial.

Foxus_lol
Автор

@7:53 What are you doing here? Just opening another tab with the Mannequin skeleton and jumping back and forth between tabs and eyeballing the pose? I mean, there has to be a better way..? Also, you cut out the video showing what values you used :(
When I go to "Retarget anim asset", my two assets have the same pose, but my "[Source]" is weirdly zoomed in and doesn't align at all. Source's head is outside the preview.
Still works though.. But there are a few more issues with this than was mentioned. A constantly lagging restart of the turning animation on continuous turning. The turning-animation isn't stopped if you start moving right after turning, so you're gliding across the ground while turning. And if you look at your shadow while turning, and then stop turning, you can see that the animation resets to the angle it had 1 second ago.

StianF
Автор

I love how following all these tutorials I find on Youtube seem to always give me a version that never works. I'm getting tired of getrting up and trying to make something only for some bug or an aspect of something to not work...

EliteInExile
Автор

Such a fluid tutorial! Its well explained and moves along at a very nice pace, thumbs up, much appreciated! :D

TheVortexPrime
Автор

Looks like Mixamo has updated to a newer version of FBX. When importing the files, I get a lot of warnings about smoothing groups in the output.

StianF