Тёмный

How to Make the NPC's Head Look At the Player in Unreal Engine 5 

Gorka Games
Подписаться 105 тыс.
Просмотров 42 тыс.
50% 1

Hello guys, in this quick and simple tutorial we are going to learn how to make a the AI look with its head at the player in Unreal Engine 5.
↪️Join my Discord Server, NOW: bit.ly/GorkaGamesRU-vidDisco...
👉Awesome Unreal Engine courses on Wingfox: bit.ly/GorkaGamesWingfoxHorro...
Check out my Steam Game! bit.ly/3rVlXU1
Follow me on Twitter: / gorkagames
Follow me on Instagram: bit.ly/InstagramGorkaGames
Subscribe to the channel: / @gorkagames
unreal engine 5,ue5,npc look at player,tutorial,quixel,megascans,unreal engine head look at,eney look at player unreal engine 5,ue5 ai look at player,ue5 head look tutorial,ue5 how to make the npc look at you,unreal engine 5 npc look at player head,unreal engine 5 head look at,unreal engine 5 look at head,unreal engine 5 how to mesh look at head, unreal engine 4,ue4,unreal engine 5 head look,ue5 enemy look at player tutorial, npc head look in ue5

Опубликовано:

 

20 мар 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 108   
@kiddskate12
@kiddskate12 Год назад
I love that when he is doing it and when he gets an error he SHOWS the error and how to fix it amazing work I cant wait for more tutorials
@GorkaGames
@GorkaGames Год назад
thank you!
@I-VisiBomb-I
@I-VisiBomb-I Год назад
except he doesn't. my character just looks up and i haven't a clue on how to fix it.
@taskipl3802
@taskipl3802 5 месяцев назад
@@I-VisiBomb-I same did you fix it?
@beckhanra
@beckhanra Год назад
Thanks mate! Used this tutorial to make player characters head follow the camera: camera world location, forward vector multiplied by some etc, from your line trace tutorial. Works like a charm
@wolfiedgr8t
@wolfiedgr8t Год назад
Excellent man,thanks for the great tutorial ♥
@miquelsalvatejedor3123
@miquelsalvatejedor3123 Месяц назад
Love you Gorka! just what i needed! Aupa ahi!
@KutsalKurt
@KutsalKurt 18 дней назад
Thank you so much for your work and help! ❤
@draicor
@draicor Год назад
Hey mate, good tutorial, I love how you explained some of the nodes too.
@al_my_pal
@al_my_pal Год назад
Your nuanced tutorials are easy to follow and help me understand these basic but immersive features. I don't even have a decent PC for unreal 5 but I'm watching these before upgrading and diving in. You've earned a sub from me sir.
@user-td9hg5pe6z
@user-td9hg5pe6z Год назад
set everyting to "low""low", and make game screen to smaller, it will be good word
@rocketpoweredchimpgamesphi7798
@rocketpoweredchimpgamesphi7798 8 месяцев назад
Great and simple as always! Thanks Gorka! :o)
@kimochisaiko6442
@kimochisaiko6442 Год назад
great as always
@Unyverses
@Unyverses 8 месяцев назад
Another Banger Brother! Another Banger
@KANAWA2025
@KANAWA2025 Месяц назад
all simple and cpntruct - good job bro!
@RaulMartinez-bt3vm
@RaulMartinez-bt3vm Год назад
Nice content Gorka, I love your tutorials, you come up with interesting content and you explain it very well! A few things, can you expand on the functions of this video tutorial to make the player character have a head tracking mechanic so the head of the character follows the camera? Also, I'm looking forward to more of your parkour mechanic tutorials like the vaulting video you made some time ago.
@larabatech1200
@larabatech1200 2 месяца назад
mindblowing as usual
@theoldrsftw
@theoldrsftw Год назад
I always wondered how to do this. Thank you for the guide.
@MilanKarakas
@MilanKarakas Год назад
Excellent!
@procrastinator24
@procrastinator24 4 месяца назад
great video, thanks! I was trying to replicate all of that on my own in my Anim BP, glad I found your video to show me a much quicker and more simpler way!
@sabramwasdart9027
@sabramwasdart9027 Год назад
Your content is amazing for a starter in Unreal Engine like me. Thanks for taking the time to do this, legend! Subbed
@GorkaGames
@GorkaGames Год назад
thank you so much! I'm glad that you find my videos useful!
@sabramwasdart9027
@sabramwasdart9027 Год назад
One of the next videos maybe how to make a mini map in the top corner of a game? 👌🏼
@zeeshankhan-gw2lv
@zeeshankhan-gw2lv 4 месяца назад
Great thanks
@FactSlash
@FactSlash Год назад
This is so cool thanks keep up the good work, and congrats on 18k subs.
@GorkaGames
@GorkaGames Год назад
thank you so much!
@LinuxPhantom
@LinuxPhantom 8 месяцев назад
Can you give us an idea of how to set it by distance? Ive noticed it follows you when your across the map. Amazing stuff by the way!
@DeWessel97
@DeWessel97 4 месяца назад
In the NPC animBP event graph, get the world location of the NPC & the player character, plug those into a Distance (vector) node. Use the resulting value to set a boolean variable, when the result < [ your preferred distance ]. Plug the bool into the Alpha of the Look At node. 🙂
@javisartdesign
@javisartdesign Год назад
Nice and easy trick! thanks
@GorkaGames
@GorkaGames Год назад
my pleasure!
@hardcoregamer739
@hardcoregamer739 Год назад
I know I'm a couple months late but do u know how to restrict that animation to distance?? As in I want the NPC to look at me when I get in their vicinity, it would be exceedingly weird if u just walk in a marketplace or just down the street and every single soul(NPC) is staring at u XDXD. Thanks in advance!!!
@ASTRAL15293
@ASTRAL15293 7 месяцев назад
what can i do if the head rotates reverse???
@ESJoell
@ESJoell 4 месяца назад
You can forgo casting in the animation blueprint by replacing it with the "is valid" node (? kind not f) from get player character, and connecting get player character return node to mesh. It works even without the is valid node, but in all likelyhood, it will produce errors because the animation updates before the player character is loaded
@IMoresoft_Studio
@IMoresoft_Studio Год назад
Thank you
@GorkaGames
@GorkaGames Год назад
my pleasure!
@AliBounds
@AliBounds Год назад
I was just playing street fighter the other day thought that was cool. Now im here
@Blowave-
@Blowave- 9 месяцев назад
Hey, I've done this tutorial, but the character instead of looking at the player, it looks up and when I move around it, it avoids looking at the player, can you pls help?
@furioarts
@furioarts 2 месяца назад
Had same. Search for "in local space" not ticked in lookat node
@ghazalmajidi
@ghazalmajidi 15 дней назад
@@furioarts Lifesaver!!!! Thank you!!
@christofferplatou2828
@christofferplatou2828 Год назад
Dope, thanks! How would I make this a variable so it wouldn't always be on?
@guxango8630
@guxango8630 Год назад
First comment. Great video!
@GorkaGames
@GorkaGames Год назад
thank you!
@GrimsinxGaming
@GrimsinxGaming Год назад
Just spot on tutorial thanks so much.. My AI character when he runs its a loop can help fix please
@lga9046
@lga9046 9 дней назад
One question. I have an instance of NPC that I have coded to do several random anim sequences as they roam the level, and after assigning this new ABP_AI_Look anim to them, I find that the animation sequences that are playing are overriding the ABP_AI_Look code to look at player. They play normally without the head moving. How can I make it so those sequences are also affected by the Look To Code in the Animation BluePrint?
@user-hm3io7sd9f
@user-hm3io7sd9f 8 месяцев назад
Thank you, look at.
@600vibe
@600vibe Год назад
Do you have one where your character could turn their head im trying to go for a realistic type of game but can’t find any videos on it
@LuciousKage
@LuciousKage Год назад
Niceee! does that work other way around too ? if i want my character to look at someone ???
@JeffreyZweigII
@JeffreyZweigII 7 месяцев назад
Head seems to freeze in the position of where my player starts, and does not move after that. any idea why it's doing that?
@RSProduxx
@RSProduxx Год назад
nice
@GorkaGames
@GorkaGames Год назад
thanks!
@Cemrekartworks
@Cemrekartworks Год назад
Hello, I just discovered you. I'm kind of new to the gaming industry. I am improving myself thanks to your content. I'm planning to make a horror game. Can you tutorial some more content about this? Things like jumpscare, moving objects, turning lights on and off, interacting with objects. + Subbed. I'm thinking about making a donation in the future for you. Thank you.
@nihilepsy3053
@nihilepsy3053 5 месяцев назад
Is there a way to make him only use 1 rotation axis like yaw
@georgebessinski2122
@georgebessinski2122 Год назад
Anybody knows how to implement it inside behavior tree, so that npc only looks at the player if he`s in line of sight?
@alejandrogarcia4394
@alejandrogarcia4394 Год назад
Hola Gorka, no sé si puedes ayudarme. Me gustaría hacer una fila de personajes andando por un mismo recorrido (spline) y que paren cada 2 segundos y luego continuen andando y que vuelvan a parar y asi, todos en fila uno tras otro. He visto ya 20000 tutoriales y no encuentro el modo. Podrías recomendarme alguno? Te estaría enormemente agradecido tio. Un saludo.
@muneebhero1159
@muneebhero1159 Год назад
Can you teach how to make score or points system
@brightboy18
@brightboy18 Год назад
Maybe you already have a video but is there a way to make the NPC/Boss AI body always face the player
@kriswintf2027
@kriswintf2027 Год назад
but how to Attach pawnsensing component to head bone?
@ryansaper
@ryansaper 6 месяцев назад
I have a problem where my character looks at me, but once he interacts or touches anything, he freezes in that position and nothing animates on him. This only happens with the look at player system, but it's fine when I remove it from the abp.
@killerthepro756
@killerthepro756 Год назад
Great vid and when will you make the hotbar and what are the details just to expect a good video
@GorkaGames
@GorkaGames Год назад
soon hopefully man!
@killerthepro756
@killerthepro756 Год назад
@@GorkaGames Great but what are the details of the hotbar video
@QuailCraft
@QuailCraft 9 месяцев назад
I'm having an issue where look at, setting the interpolation time does nothing. its set to 3000 and the head snaps instantaneously.
@kenalpha3
@kenalpha3 Год назад
My head bone is -Y down, +Z forward (eyes forward). And +X is left ear. What do I put for Look up Axis or Look At axis? (I tried all 3: X only (1, 0, 0), Y only (0, 1, 0), or Z only (0, 0, 1). But my AI neck is not rotating along the Y axis, it is tilting sideways.) [Edit 2: #2 solved. But #1 and 3 arent] 2) My AI is a child of my char BP (thus its anim BP uses same as Player). So what is the logic that if self = Player (human), then dont do the neck turn? Do I put that check in Event Graph or AnimGraph? I dont see the node (in AnimBP terms) to [get self] or [get is player] node, so I can add a Bool branch.) Ty Edit 2: The Bool in Event Graph has to be before the Cast To. So before his CastTo 1:38, add [Get Owning Actor] == [Get Player Character]. Feed that into a Branch. (If the Owning Actor of the AnimBP equals Player Character, then True for the Branch.) Then make and set a new Variable called "Is Player?" (this Var is needed to fix my problem of not being able to add the same == check nodes in Anim Graph.) So then in Anim Graph, add [Blend Posses by bool]. Drag in "Is Player?" at red pin. At True Pose, add a Saved CachedPose of BEFORE the head turn code. And at False (if we are not player - then we will use his head turn code), connect the Output of his Head turn code. Then the Output of [Blend Posses by bool] connects to your final [Output Pose] node (running guy icon). I also added a 2nd Look At node for Spine1, Clamped at 10. And I split the Z pin of "Look at POS." I subtract 50 before it plugs into the 2nd Loot At node (for spine1, since it is lower than head/eye height, I dont want the spine tilting up too much). ==============OLD Edit: I did try putting Blend Posses by Bool in AnimGraph, with a bool and [Get Player Character] == [self]? But it gives a warning for using [Get Player Character] node in AnimGraph: _"Node Blend Poses by bool uses potentially thread-unsafe call Get Player Character . Disable threaded update or use a thread-safe call. Function may need BlueprintThreadSafe metadata adding."_ I also put the Bool in Event Graph, but it seems to do nothing for true vs false.
@kenalpha3
@kenalpha3 Год назад
How do we reduce/clamp the Tilt chin up/down more than the Twist neck (rotate)? They use the same value = unrealistic. When my player is very close and jumps, the AI chin tilts up too fast/too extreme, even with Interpolation time = 10. The Clamp angle is too big for Chin up. I want to reduce it by 1/2. Because irl the eyes will move up before the head tilts up - thus the chin will not tilt up so extreme/fast. But in UE, they are treating the neck Twist and Tilt up as the same value.
@Slaysh3rxx
@Slaysh3rxx 6 месяцев назад
How can we do in fps ? İ worked too much but cant do :(
@screenapple1660
@screenapple1660 Год назад
Wait... how do you make a player turn its head on enemy and far away head turns with mouse?
@ulurag
@ulurag Год назад
Can you make a video about how to child collision components so they move together with the mesh as it animates, like if you have a bird and put a capsule collision on the beak and as the bird moves into different poses the capsule collision component moves and rotates with the beak of the bird wherever it goes?
@kenalpha3
@kenalpha3 Год назад
Do you mean a Character? > SK mesh? And which engine? Im using modular meshes in UE4.27, with Set Master Pose component/function. Which means I have my default SK player "mesh." Then I added a child mesh. But when I imported, they share the same skeleton (but different parts of the mesh are filled in. E.g. just body mesh or just hair mesh). Thus the Set Master Pose node syncs their animations together to use only the anim BP set for "mesh" (and saves processing.) But you can apply different physics to the child meshes, like wiggle hair, something in the bird beak. But UE4.27, their default physics is very extreme/buggy unless you fine tune 100 settings that they dont explain. Idk if they fixed in 5.1. But there is an addon called Kawaii physics. It may be easier to setup like I said above, then use Kawaii to make the [worm/beak] wiggle - connected to the main SK mesh body/move with the animation - let have some independence.
@jesseyules
@jesseyules 9 месяцев назад
Hi! Q: What settings should we change if we're using BP First Person?
@simu_lacra
@simu_lacra 8 месяцев назад
The only thing you have to change is to cast to your FirstPersonCharacter BP instead of third person in the event graph.
@mechuxxxxxx
@mechuxxxxxx Год назад
hi, great tutorial, can you add how to limit his range when he start looking, because it will gonna look weird with a room full of people constantly watching you at every second :)
@kenalpha3
@kenalpha3 Год назад
Same. I wish he'd show/code the features/pre answer the basic questions that most modern games already have by 2023 - to make it a complete tut. Because I see a lot of people asking the same thing. I semi know the logic, but not how to implement in Anim BP, because the nodes are kinda restrictive/backwards compared to Blueprint code. Thus I am left wondering with you. Also he's using CastTo player, and only showing how this works against a single target (Player). By 2023, someone knows how to code it for Wildcard/BPI - look at whoever the AI is currently looking at (e.g. last interacted Actor/Player or closest distance). But again, I dont know how to implement that in AnimBP. So it's frustrating when I know the answer/code exists, but not shown, so I must keep searching.
@heresmynovel331
@heresmynovel331 Год назад
Have you found any answers please???
@mechuxxxxxx
@mechuxxxxxx Год назад
@@heresmynovel331 nope, i just stoped watching his tutorials, because its getting me nowhere above things he is showing
@mechuxxxxxx
@mechuxxxxxx Год назад
@@heresmynovel331 and i bought udemy course unreal blueprints 101 so im aproaching this problem with learning from the beginning
@chavlaz
@chavlaz 8 месяцев назад
it works;... but it's all inversed. any ideas?
@Moctop
@Moctop 10 месяцев назад
That's nice but how to you blend it into an existing animation?
@EisonDoesEverything
@EisonDoesEverything 6 месяцев назад
Could use an animation notify state and then send it via a blueprint interface which sets the value you need on notify begin and notify end.
@bazio5592
@bazio5592 Год назад
Maybe locomotion system next ?
@GorkaGames
@GorkaGames Год назад
check my RPG #2!
@cyanicgames5224
@cyanicgames5224 6 месяцев назад
I dont know why but the way my character looks at player seems to be inverted? It looks to the opposite direction, when he is on my left side the character tilts head to their right side. Any idea how to fix this?
@stibaer573
@stibaer573 6 месяцев назад
Had the same problem. I was able to solve it by going into the AnimationBluePrint, AnimGraph, selecting the yellow LookAt and on the right side under Details under LookAtAxis, changing the Y-Axis from 1,0 to -1,0. I hope this helps.
@TolisPiperas82
@TolisPiperas82 Год назад
I hope will add it in the ai of the rpg series in the future?
@GorkaGames
@GorkaGames Год назад
yes!
@TolisPiperas82
@TolisPiperas82 Год назад
@@GorkaGames when is the next rpg video?
@projectMAINCORE
@projectMAINCORE 6 месяцев назад
cast to third is not showing up so its not working anymore.
@BLOG_BAR
@BLOG_BAR 5 месяцев назад
how to do this with the character's head, the same mechanics do not work, it tears off the head
@GAMINGWITHSHANMUKH
@GAMINGWITHSHANMUKH Год назад
Is this video applicable for the rpg series??
@RSProduxx
@RSProduxx Год назад
of course
@GorkaGames
@GorkaGames Год назад
yeah!
@g-dojjo
@g-dojjo 8 месяцев назад
Thanks for tutorial!! :3 but i have a weird problem with rotation way :D My AI looking at to reverse side :D When my player right AI looking at Left side :D
@g-dojjo
@g-dojjo 8 месяцев назад
Okey im fix it lol :D If your AI looking at another way just adjust : In "AI" Anim Blueprint---Anim Graph--Look At(NOD)Click it--at Right Panel Find"Look At Axis" in Skeletal Control--Change Axis! mine is "Y" "-90"
@TrespasserAlt
@TrespasserAlt 9 месяцев назад
for some reason my character is looking up while tracking the player, pls help.
@Mr.Chris_PL
@Mr.Chris_PL 4 месяца назад
Make sure to select the look at node and in details in look at axis part disable in local space, worked for me.
@user-yy8hl6hf4o
@user-yy8hl6hf4o Год назад
The head is looking in the opposite direction, how to fix it?
@SigmaBGE
@SigmaBGE 7 месяцев назад
Same..
@allashama
@allashama Год назад
this technicle doesnt work if your target to look at is an object without head bone. The AI will look up in the sky instead of looking at target, even with the Actor Location. If someone know the tip to make the AI looking at a target instead of a head bone. Thanks!
@I-VisiBomb-I
@I-VisiBomb-I Год назад
I have a head bone and it still just looks up.
@emptybruh
@emptybruh Год назад
@@I-VisiBomb-I Yea for me, not sure whats going on, have you figured it out? The problem is caused by Mixamo rig joints being wrong orientation
@Mr.Chris_PL
@Mr.Chris_PL 4 месяца назад
For the looking at sky just make sure to select the look at node and in details in look at axis part disable in local space, worked for me.
@TheDudeAbides421
@TheDudeAbides421 Год назад
Algo
@2010Edgars
@2010Edgars 9 месяцев назад
My npc enemy looks with degree offset.
@wallacejvm
@wallacejvm 5 месяцев назад
Casting in update animation is not a good practice, it will make you lose a lot of performance in the blueprint
@nassergreatdeveloper3745
@nassergreatdeveloper3745 Год назад
3:23 🤣🤣🤣🤣🤣
@FoxoticTV
@FoxoticTV 7 месяцев назад
Nice but you forgot to mention how to do this within proximity, they're always gonna look at you even 100000 miles away.
@I-VisiBomb-I
@I-VisiBomb-I Год назад
like someone said before, the character just looks up at the sky all the time. this is disappointing...
@gail_blue
@gail_blue 4 месяца назад
For April fools, you should make a video that's hard to follow.
@sideeffectstudios7236
@sideeffectstudios7236 3 месяца назад
Nice tutorial but it didn't work
Далее
How to Make a Pet Companion AI in Unreal Engine 5
7:18
UNO!
00:18
Просмотров 757 тыс.
Unreal Engine 5 AI NPC Tutorial
9:27
Просмотров 36 тыс.
Adding an AI Monster to my Horror Game - Devlog #2
7:43
How I Remade MW2 with Unreal Engine 5
12:37
Просмотров 3 млн
How to Make a Simple Turret in Unreal Engine 5
7:15
Просмотров 25 тыс.
6 Best Unreal Engine Plugin [FREE]
6:02
Просмотров 42 тыс.
Why I'm ADDICTED To Filmmaking In Unreal Engine
8:02
Просмотров 345 тыс.
How to Make a Simple Minimap in Unreal Engine 5
10:22