Тёмный

How To Make The AI Head Follow The Player | Unreal Engine Tutorial 

Matt Aspland
Подписаться 81 тыс.
Просмотров 21 тыс.
50% 1

Hey guys, in today's video, I'm going to be showing you how to make the head of the AI character follow the player's movements. So only the head will smoothly rotate to follow where the player goes.
A simple fix for a minor bug in the code: imgur.com/a/0YOfRrq
(Please read the above link, I have explained it all in there. The bug is that if the AI is facing a different direction, it won't work perfectly, this fixes that issue.)
#Ue4 #UnrealEngine4 #Ue4Tutorial
___________________________________________________________________________
00:00 - Intro
00:18 - Overview
00:56 - Tutorial
11:13 - Final Overview
11:48 - Outro
___________________________________________________________________________
My Public Video List: trello.com/b/7vJgXzBm
My Patreon Page: / mattaspland
Unreal Engine 4 Tutorials Playlist: • Unreal Engine 4 Tutorials
The Basics Of Nodes Playlist: • The Basics Of Nodes In...
Blender Tutorials Playlist: • Blender Tutorials
___________________________________________________________________________
If you enjoy make sure to subscribe: / @mattaspland
Join My Discord Server: / discord
Follow Me On Instagram: / matt_aspland_
All My Social Media Links: linktr.ee/MattAspland
___________________________________________________________________________
If you want to support me, you can PayPal me at "matt.aspland.1@gmail.com". This is by no means expected or required. It is just a nice support :)
My Patreon Page: / mattaspland
Link to PayPal: www.paypal.com/
You can also support me on Ko-Fi following this link: ko-fi.com/mattaspland
Thank you :)
___________________________________________________________________________
♫Music By♫
●Kronicle - Chill Noons
●Soundcloud - / the-chemist-10

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

 

1 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 76   
@MattAspland
@MattAspland 3 года назад
A simple fix for a minor bug in the code: imgur.com/a/0YOfRrq Please read the above link, I have explained it all in there. The bug is that if the AI is facing a different direction, it won't work perfectly, this fixes that issue. I only noticed this after uploading the video, so my apologies for not covering it in the video, but I have fixed it for you already. All the best to you all, stay safe!
@zoravibes
@zoravibes 2 года назад
Not a fix as the AI still looks off in other directions if oriented toward + or - X.
@stephenmontague6930
@stephenmontague6930 2 года назад
Hey, could be wrong, but here's a simple fix : Just subtract [FindLookAtRotation, Z (Yaw) - GetActorRotation, Z (Yaw)] in the AnimBP. You'll need to use a TryGetPawnOwner node (same as before) to do the GetActorRotation, and Make sure the Order of subtraction is correct. I've tested with an AI facing 4 cardinal directions, world (x, -x, y, -y) and it always turns to the player now. Thanks for the overall setup. Still a "Liked" video. Good luck.
@errormachine5056
@errormachine5056 2 года назад
my problem is that there is no asset details tab. im stuck on step 1. why dont i have an asset details tab?
@stephenmontague6930
@stephenmontague6930 2 года назад
@@errormachine5056 It's either hidden behind another tab or closed - try going to Windows > Details.
@TheZoobZoobs
@TheZoobZoobs 2 года назад
@@stephenmontague6930 thanks buddy!
@jcmee91
@jcmee91 3 года назад
My AI are going to be so fleshed out by the time i watch all of your AI videos. Thank you!!
@MattAspland
@MattAspland 3 года назад
That's great to hear man! So happy to help! :)
@blitz_786
@blitz_786 2 года назад
Thanks so much for this man! This is exactly what I was looking for! Literally thought "Has Matt posted a head rotation tutorial?", and here it was! Massive thanks dude, you're the best! 😊
@VSimCardV
@VSimCardV Год назад
Nice tut! You can also do this by using "Transform (modify) bone" in the anim graph of the animation blueprint, if you don't want to make the pose assets and aim offset.
@Vexod14
@Vexod14 Год назад
Thanks for another cristal-clear tutorial Matt ! This helped bringing aim offset to my clones & droids =D
@geoffrey3668
@geoffrey3668 2 года назад
Thank for th tutorial! This save me a lot of headhache!
@Anonymous-mf8ip
@Anonymous-mf8ip 3 года назад
This is awesome!
@MattAspland
@MattAspland 3 года назад
Thanks a tonne bro!
@KutsalKurt
@KutsalKurt 19 дней назад
Thanks so much! ❤
@trytry5837
@trytry5837 3 года назад
Hey Matt thank you for your tutorials i learned alot from you and you explain everything very well i want to ask if you can make a tutorial about animations in First Person where you interact with objects for example you open a door and your fps hands interact with the door or you climb a ladder what ever i want to know how to get the correct position between the character and the object for the animation to look smooth i have watched your ladder tutorial for TPS but it is not what im looking for Thanks!
@antonio_707
@antonio_707 3 года назад
jesus christ, i googled this and lo and behold Matt’s just uploaded again 😂
@MattAspland
@MattAspland 3 года назад
Hahaha glad to hear Google likes me lol
@stevenwynn819
@stevenwynn819 3 года назад
You've once again done a great job of explaining a useful animation technique. Thanks, Matt!
@cryptic4062
@cryptic4062 3 года назад
Thank You so much!
@MattAspland
@MattAspland 3 года назад
Always a pleasure to help :)
@Fooq
@Fooq 2 года назад
You are a legend!!!!
@FawziRU
@FawziRU 3 года назад
Thank you so much 💓
@MattAspland
@MattAspland 3 года назад
No problem at all man :)
@primitivepatterns
@primitivepatterns 3 года назад
Hey Matt, could you make a video on how to incorporate multiple skeletal meshes into a character blueprint? I'm trying to make a gun that has it's own animations and still attach it to a bone on a character, thanks as always!
@Ray_joy
@Ray_joy 3 года назад
thank you sooo much
@MattAspland
@MattAspland 3 года назад
It's a pleasure :)
@GBTC2011
@GBTC2011 2 года назад
Can you do one on the character head rotation with the mouse-gamepad?
@rodroeq7956
@rodroeq7956 3 года назад
Amazing!!! I think I can use this to create a leaning aditive for my walk/run BS, thank you bro, you are the best!!!
@MattAspland
@MattAspland 3 года назад
That's amazing to hear bro, always great to see people advancing their knowledge! All the best to you man, glad I could help out! :)
@que_scopes1224
@que_scopes1224 3 года назад
Hey matt not been here for a while haha pc has been broke😂😂
@artdrawing6682
@artdrawing6682 2 года назад
Cool
@manicmice
@manicmice 3 года назад
poggers, love ya
@MattAspland
@MattAspland 3 года назад
All the best to you brother!
@javisartdesign
@javisartdesign 3 года назад
Dunno if it would be easier using control rig and moving the face by using Aim Math node and using the target as an input?
@MattAspland
@MattAspland 3 года назад
Possibly yeah, I haven't messed about with UE5 and control rigs massively just yet, great idea though!
@HavokBWR
@HavokBWR 2 года назад
So Im tying to get this to work with my VRmotionController Pawn but the ai head isnt tracking my vr head... any idea what I could do?
@eritumakafakafo3008
@eritumakafakafo3008 Год назад
Hot to rotate eyes like that? I got bones for each eye and i want eye to move when enemy is goin around me and vice versa
@Medicbobs
@Medicbobs 2 года назад
Trying to animate a tripod robot. Do you think this tutorial will work with that?
@TorQueMoD
@TorQueMoD Год назад
This is an overly complex way to get an NPC to Look at the player that also requires you to make custom animations to cover a multitude of scenarios. Like what if you want the NPC to look at the player while walking? The easier method is to simply GetActorLocation of the Player Reference you made and promote this to a variable called LookLocation, then in the AnimGraph add a "Look At" node in between the Locomotion State and the Output pose. Highlight that node and where it says Look At Location under the Target category, click the Bind drop down and select Expose As Pin. Plug your LookLocation into the pin and set the Bone to Modify to the Neck bone. Then Under Look At Axis, uncheck the Local Space pin, set the Look At Clamp to 50 and interpolation time to 0.25. Done, and it'll work with all animations.
@LorneDev
@LorneDev Год назад
omg that was easy, thanks
@YouZido
@YouZido 9 месяцев назад
Interpolation time is broken as it can't be set, there seem to be a bug. even if you set 500 the look at will still snap
@dirklourens9146
@dirklourens9146 5 месяцев назад
works perfectly thx
@errormachine5056
@errormachine5056 2 года назад
sometimes small things stump me. like you went immediately into the asset details tab. i dont have the asset details tab. how do i get it to appear?
@CommanderColson
@CommanderColson 3 года назад
Could this method be used at the AI’s waist to simulate AI aim offset? As in get enemy shooter AI’s to shoot up at me if I am above them, and down at me if I am below them?
@MattAspland
@MattAspland 3 года назад
Hey. this could absolutely be used for that yep. If I'm understanding you correctly, I made a video on this previously :) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-PZqzhGhANx4.html
@KWang-yy2qk
@KWang-yy2qk 2 года назад
Thanks for sharing, I followed the Tutorial a few times and also added the bug fix. It still doesn't work. Any hint on troubleshooting?
@zoravibes
@zoravibes 2 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FxyRzooc-lM.html (Works perfectly!! A quarter of the work, and can look up and down without ANY bugs!
@thotchocolate9042
@thotchocolate9042 Год назад
Hmm @10:04 for some reason the yaw barely changes for me, by like 0.0001 no matter how fast I move, maybe this doesn't work for a 2.5D sidescroller?
@raktimjs
@raktimjs 3 года назад
Could you make one more video on advanced Graphics menu??? Actually the old one doesn't look so good.. don't take me wrongly, it's not bad at all!!
@danimusbar
@danimusbar 3 года назад
tks Dude, its help me.. please make AI to attack us
@thedog2320
@thedog2320 3 года назад
having a problem where it is not accounting for the actors rotation. so while my actor is facing north, it works just fine, when he faces south it appears as if the values are inverted so instead of looking left to face me, he faces right away from me and transitions to the other side as i cross his line of sight. any idea what that might be?
@zoravibes
@zoravibes 2 года назад
The video in the link below works perfectly!! It doesn’t require any animations, it’s not even a quarter of the work, and the AI will even look up and down at you without ANY bugs! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FxyRzooc-lM.html
@kichmadev
@kichmadev 2 года назад
UE5 anim offset 1d wont budge at all. Don't know whats wrong.
@unrealdevop
@unrealdevop Год назад
I've been using this method for days now and it isn't working properly. I came across your video and was hoping you might understand why....basically I need the Pitch Value off it to adjust the aim for a small creature so that a Zombie swings downward at it....I used the same method you did but the Pitch value returned seems to be incorrect....it's too small. I'm not sure I understand why either.
@unrealdevop
@unrealdevop Год назад
Know what scratch that, I had the Pitch disconnected on the Anim Instance Side lol
@DeadEndGames
@DeadEndGames Год назад
My ai does not look in the correct direction as my character. Can anyone help?
@smutnyziomek63
@smutnyziomek63 3 года назад
Can you please make tutorial how to make isometric game?
@MattAspland
@MattAspland 3 года назад
Nice idea, I can look into it for the future
@smutnyziomek63
@smutnyziomek63 3 года назад
@@MattAspland i can't find anything about that on UE forum and YT
@zoravibes
@zoravibes 2 года назад
Even with the “fixed” code the AI will not look right at the player unless it is oriented toward the Y axis in world space…
@zoravibes
@zoravibes 2 года назад
The video in the link below works perfectly!! It doesn’t require any animations, it’s not even a quarter of the work, and the AI will even look up and down at you without ANY bugs! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FxyRzooc-lM.html
@fleurbird
@fleurbird 3 года назад
Oooh so that's how.
@MattAspland
@MattAspland 3 года назад
Yeah more simple then you might expect! All the best to you :)
@sonny5974
@sonny5974 Год назад
Doesn't work in UE5 (at least for me)
@phildavis42
@phildavis42 2 года назад
Doesnt work! Acessed none in YAW
@KWang-yy2qk
@KWang-yy2qk 2 года назад
Same here. did you find a solution? :)
@TonyDevGame
@TonyDevGame 2 года назад
@@KWang-yy2qk Dont work, i cant find a solution.
@zoravibes
@zoravibes 2 года назад
@@TonyDevGame ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FxyRzooc-lM.html Works perfectly!! A quarter of the work, and can look up and down without ANY bugs!
@khazinianimation
@khazinianimation 2 года назад
.
@khazinianimation
@khazinianimation 2 года назад
I'm so sorry i got hack by someone
Далее
Ne jamais regarder une fille à la plage 😂
00:10
Просмотров 1,1 млн
Good deed #standoff #meme
00:15
Просмотров 828 тыс.
Аминка ❤️
00:16
Просмотров 1,1 млн
Brawl Stars Animation: PAINT BRAWL STARTS NOW!
00:52
How to Make a Simple Turret in Unreal Engine 5
7:15
Просмотров 25 тыс.
Ne jamais regarder une fille à la plage 😂
00:10
Просмотров 1,1 млн