How to Make Head Follow Camera - UE4 Tutorial

  Рет қаралды 31,286

Lou's Creations

Lou's Creations

4 жыл бұрын

I've seen many overly complicated ways to make the head follow the camera in a third person game, so I wanted to offer my fairly simple solution. Complete solution with additive rotation which blends well with any animation. Furthermore, it's all done by only using the animation blueprint.
Enjoy!

Пікірлер: 62
@LouSimonsen
@LouSimonsen 4 жыл бұрын
OBS! You should run your "Follow Camera" reference through a '"sValid?"-node before using it in the "HeadFunc" since it's not inherited by the character class. It will still work if you don't but you will get an error. To elaborate; when you look inside the AnimBP's Event Graph you see the first thing which is done is to run the player through an "IsValid?" node. Do this with the follow camera node in the HeadFunc :)
@anasdev1553
@anasdev1553 3 жыл бұрын
@Havis yes it is use anycamera you want
@sarahstelljes907
@sarahstelljes907 3 жыл бұрын
How exactly do I do this? I get what the overall idea is, but I'm still pretty new to UE4 and I'm using the latest version, 4.26.
@imaginaryconception
@imaginaryconception 3 жыл бұрын
THXXXXX!!!!!
@gamingman936
@gamingman936 Жыл бұрын
Thank you still helping 2 years later.
@danico.8520
@danico.8520 3 жыл бұрын
When your looking behind your character there's a little detail, the head moves too fast and it does not seem natural, the way of solving it is using a "Finterp to" before set the Z (Yaw Of the finall setter), you have to promote to a variable the Z of the Finall Setter and Set it on the Flow before the Finall Setter then use the Finterp to before the Clamp of Z and put the Variable promoted before on "Current" and then put on "Target" the result of the "Clamp", after that Set it on the Setter of the Promoted Variable in the flow and connect that to the Finall Setter
@ozdev
@ozdev 2 жыл бұрын
This works! So drag off the yaw/z from the last set head rotation node and type Finterp to - for the current of the interp node, drag in a get head rotation and split the rotator and connect the z/yaw to the current. The target connects to the last clamp angle node output. For delta time, type "get world delta seconds" node and connect it to the delta time, and for the Interp speed set it to 10.
@jetkwok7908
@jetkwok7908 2 жыл бұрын
@@ozdev Bless you
@RudeDudeKB
@RudeDudeKB 2 жыл бұрын
@@ozdev The results are perfect now, thanks :)
@50meters20000tons
@50meters20000tons 2 жыл бұрын
@@ozdev thanks for this!
@GAMEBR0VIP2462
@GAMEBR0VIP2462 Жыл бұрын
@@ozdev perfect.need to comment this to the general comments so nobody else has to search through.
@andrewmd10
@andrewmd10 4 жыл бұрын
just did it. its working perfectly
@JoJoKuma1
@JoJoKuma1 6 күн бұрын
for those who had errors making follow camera valid like me, you can right click on the target -> follow camera node and at the bottom there is an option called "convert to validated get"
@stormr
@stormr 2 жыл бұрын
Is there a way to make it smoother when walking/running back at the camera. I only get my character head snapping left and right regardless of the extra clamp, which I am fine with if I could get a smoother rotation rather than snapping. And like Lou said in order to get rid of errors in newer version, in the headrotfunc after the call to character add an 'isvalid' in there, then drag a link from the follow camera into it, nothing else has to be connected other than the main exec that goes to the set node at the end. this gets rid of the error
@danico.8520
@danico.8520 3 жыл бұрын
Good video, but there's a bug when you see down with the cursor, the head starts moving really fast in the Y (Pitch of Finall Setter), the way of solving it is setting in the Clamp before the Setter on 0 on min and 0 on max (In the head movement we dont need that)
@eemil333.
@eemil333. 3 жыл бұрын
Still a good tutorial! Thx :)
@ToTaLoVeR
@ToTaLoVeR 4 жыл бұрын
Great, thanks !
@dingledongle307
@dingledongle307 4 жыл бұрын
Hey man, great video. I'm just starting out with unreal and this was so useful. I was wondering what I could do to have a smooth animation play when the player switches sides from the back (as it currently just snaps to the other side). I was also wondering if there is a method of keeping the player head forward instead of left when the camera is in the back. Also, when you look all the way down the character's head rotates oddly. A followup video would be great! Thanks
@LouSimonsen
@LouSimonsen 4 жыл бұрын
Hello there, good questions! If you are learning i think you should try to fix these yourself. I will however give you some pointers. 1. By smoothing you mean not instantly switching direction. Yes, I would do this by restricting the max difference in angle per tick. Limit the value using a clamp depending on the current angle. 2. By using a 'Branch' you can set it so when the camera is over a certain YAW rotation he will look straight ahead instead. 3. The head movement in real life is a combination of neck and head rotation. You could try applying some of the rotation to the 'neck bone' also :) If some of these seem vague I will gladly answer any question.
@leroywang9555
@leroywang9555 4 жыл бұрын
@@LouSimonsen Hey man, it's a little late but I saw this comment about making the head turn smooth and I just can't figure out where to put the clamp to limit the current angle! Some help would be appreciated, thanks in advance!
@ThreeTreeDog
@ThreeTreeDog 2 жыл бұрын
This is a couple years old, and Im working in UE5 atm, I cannot seem to get it to work (newb) I get a error after runtime, none in the set headrotation. Im prob doing something wrong.. although it is a pretty simple setup...
@50meters20000tons
@50meters20000tons 2 жыл бұрын
Thank you!
@JuanSanchez-jd2nu
@JuanSanchez-jd2nu 3 жыл бұрын
Thank you ;)
@Grand-warden
@Grand-warden 3 жыл бұрын
Thank you so match
@KayloMaster
@KayloMaster 2 жыл бұрын
You're doing God's work friend
@fahood9242
@fahood9242 4 жыл бұрын
great tutorial but how can i make my meshs head look at the player for example i have a turret model and i want its head to look at the player
@LouSimonsen
@LouSimonsen 4 жыл бұрын
Use the "Find Look at Rotation"-node to set the head rotation :)
@ldracarys9905
@ldracarys9905 3 жыл бұрын
how do you get "FollowCamera" at 2:10, i don't see this, i see it's a variable but i don't know what type of variable it's, im new in ue4 pls can u help me
@uumpquaoogla3939
@uumpquaoogla3939 3 жыл бұрын
In case you're still wondering, FollowCamera is just the default name given to the camera for the third person character blueprint's camera. If you made your own character blueprint it might be called "camera" or whatever else you chose to name it
@Graylord88
@Graylord88 4 жыл бұрын
This setup suffers from gimbal lock, any suggestions on how to get around it?
@MaraisStephane
@MaraisStephane 4 жыл бұрын
prevent the head from bobing fully vertical, a lot of games are locking the lookup at 10 degrees from pure vertical
@alejandromontenegroreyes724
@alejandromontenegroreyes724 4 жыл бұрын
Hi, i tried to do this but the camera stock on top of the character looking down i have no control of the camera, what do you think that could be the problem?
@LouSimonsen
@LouSimonsen 4 жыл бұрын
Well, this function only gets information from the camera in form of location and such, but it never alters the camera information. So the issue will lie somewhere you have used the camera to get information and accidentally set the information to something new. I would check every place where you have a reference to your 'camera' in your function. I would also check everywhere you have a reference to 'control rotation'. Check if you used 'set' instead of 'get' or if set your control rotation to something.
@alejandromontenegroreyes724
@alejandromontenegroreyes724 4 жыл бұрын
@@LouSimonsen Hi, you were right it was a bad setting in the camera, i am trying that the camera direction make the character rotate as well with a delay (the head turns to a limit then the hole body turns)
@LouSimonsen
@LouSimonsen 4 жыл бұрын
Alejandro Montenegro Reyes I’ve made a similar setup since i made this video, the animations for it should be in the download file as well. I made it so when character hit 0 velocity (stranding still) it would save the rotation and once turned 90 degrees from that it would play the ‘turn Body’ animation. How do you do it?
@alejandromontenegroreyes724
@alejandromontenegroreyes724 4 жыл бұрын
@@LouSimonsen i am still trying to figure it out, " it would save the rotation and once turned 90 degrees from that it would play the ‘turn Body’ animation." that is my idea too but so far no luck
@GAMEBR0VIP2462
@GAMEBR0VIP2462 3 жыл бұрын
@@alejandromontenegroreyes724 Maybe if vamera default location is 0 and you make the transition say if "camera location "
@Kramez
@Kramez 4 жыл бұрын
How can replicate this for multiplayer? currently I can only get the client to replicate to the server
@LouSimonsen
@LouSimonsen 4 жыл бұрын
Ok, this requires more knowledge about multiplayer systems than this head setup, but i will give you some pointers. - The variable has to be communicated to the server, depending on wether or not the player is the server already. The node you need here is called "Switch Has Authority" and can only be accessed within a character_BP, not anim_BP (For test of these systems i recommend testing with "Run on Dedicated Server" switched on) - You have to do this by replicating the Head Rotation in the Character_BP NOT the Anim BP. Fastest way to do this is just to make a custom event in the Char_BP which recieves the head rot information. And then you cast to the char BP inside the Anim_BP to get this information again. - Something you need to be vary of is that the player controlling the character sees the constant update of the Head Rot and the interpreted Head Rotation is what other players see. - Doing something like this similar to "Aim Offset" systems. So you should prob look into how people replicates these systems :)
@Kramez
@Kramez 4 жыл бұрын
@@LouSimonsen Thank you!!
@AntonioFreyre
@AntonioFreyre 3 жыл бұрын
How can you make it so he doesn't look to the side when running front/back
@YunethAlwis
@YunethAlwis 3 жыл бұрын
watch promethius head rotation tutorial
@domcamjunk1400
@domcamjunk1400 3 жыл бұрын
adjust your clamp sizes
@kenalpha3
@kenalpha3 Жыл бұрын
@@YunethAlwis link? channel name? That name wasnt found. And got a bunch of movie spam
@YunethAlwis
@YunethAlwis Жыл бұрын
@@kenalpha3 dang, he has renamed the channel i believe now its UE4 Poseidon, kzfaq.info/get/bejne/pJN3irlqzMCWiqM.html
@jaywilliams9721
@jaywilliams9721 3 жыл бұрын
How come my characters head is looking directly at the camera?
@Perkins.Garage
@Perkins.Garage 3 жыл бұрын
I’m having the same issue, it’s like my character is looking in the opposite direction of the parameters set in the video
@NoonCall
@NoonCall 3 жыл бұрын
@@Perkins.Garage im just commenting incase someone comes along with a fix :D
@marcoschmid9027
@marcoschmid9027 3 жыл бұрын
@@NoonCall have u tried increasing the x value for the rotate vector in the HeadRotFunction?
@The_Industry
@The_Industry 2 жыл бұрын
Probably too late, but I was able to fix it by changing the subtract node to an add node.
@twitchingpsycho
@twitchingpsycho 4 жыл бұрын
How can we account for character body orientation as well? What i mean is that if a character is in prone, the head turns in directions as if it would be standing, it would be nice if the character attempted to tilt head and rotate head towards the cameras direction. Since i suck at math, my idea was to actually edit the Epic skeleton and add a eyes bone and use IK to rotate the head in such way to always try and rotate head where the camera is look at. It can probably be achieved with rotations but again, i suk at all that vector and rotator math. xD So a tut would be nice for that. Thanks anyway!
@LouSimonsen
@LouSimonsen 4 жыл бұрын
What you are looking for is called 'Aim Offset' :)
@twitchingpsycho
@twitchingpsycho 4 жыл бұрын
@@LouSimonsen Sorry, don't know what you mean. 😅
@LouSimonsen
@LouSimonsen 4 жыл бұрын
NxT Aim offset lets you attach animations to certain rotation, for example making a 3rd person character aim upwards. You could use this in a prone to make an animation of how to rotate when looking bsckwards. Try looking at tutorials on youtube for it 👍
@twitchingpsycho
@twitchingpsycho 4 жыл бұрын
@@LouSimonsen I guess but I wanted to make it completely independent from any animations. I'll fiddle around it some more. Because the character should have peeking, prone on back, sides and belly, making it mesh orientation aware would be technically a better implementation then animation dependent. Note I'm not using any anims yet, just rotating the char mesh around trying to achieve dynamic head movements. Worst part, I know it's possible just I suck at math so bad, man that's sad. 😭😂😭😂😭😂 But thank you so much for so fast feedbacks! Btw, the aim is to make an mgs4 style player movement system. Tho prone is turning to be a pain with the collision capsule and all...
@solideogloria5553
@solideogloria5553 Жыл бұрын
a much easier way is just to on begin play: -- set 3rd person camera active -- set controller rotation yaw to true. done
@Vaiskiz
@Vaiskiz 8 ай бұрын
which looks shit
@lollerkiller900
@lollerkiller900 Жыл бұрын
am i the only one where the head is turned towards the camera instead of away from it?
@rrwevvfaefb5215
@rrwevvfaefb5215 3 жыл бұрын
can barely hear you
@rrwevvfaefb5215
@rrwevvfaefb5215 3 жыл бұрын
max volume
@Tronnos840
@Tronnos840 2 жыл бұрын
Thats a kinda fast tutorial ngl🤣💀
@KeyMondYTGaming
@KeyMondYTGaming 2 жыл бұрын
BRO SPEAK UP
Better Camera Movement in UE4 - FAST
2:00
Amber Scott
Рет қаралды 30 М.
How to make Head turn camera - thirdperson
16:04
Jonas Mølgaard
Рет қаралды 38 М.
Ouch.. 🤕
00:30
Celine & Michiel
Рет қаралды 28 МЛН
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 21 МЛН
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 784 М.
How to Make the NPC's Head Look At the Player in Unreal Engine 5
4:54
How To Set Up The Ultimate... Ultimate True First Person Camera - Unreal Engine 5 Tutorial
15:53
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 11 М.
How To Set Up The Ultimate True First Person Camera in Unreal Engine 5
9:55
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 14 М.
UE4: TUTORIAL #9 | Rotate head to camera
12:59
UE4 Poseidon
Рет қаралды 16 М.
How To Switch Animation States in Unreal Engine
33:46
Quinn Anthony
Рет қаралды 20 М.
How to focus player camera on Vector or Actor [UE5 Tutorial]
5:26
DeadEagle [Spitfire-Games]
Рет қаралды 16 М.
UE4 Control Rig Head IK
11:01
It's Me Bro
Рет қаралды 9 М.
Ютуберлер Schoolboy runawayда БАРЛЫҚ КОНЦОВКА жеңді!
27:22
Ютуберлердін-Реакциясы
Рет қаралды 73 М.