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!
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.
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! 😊
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.
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.
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!
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!
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.
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?
Hey. this could absolutely be used for that yep. If I'm understanding you correctly, I made a video on this previously :) ruclips.net/video/PZqzhGhANx4/видео.html
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?
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! ruclips.net/video/FxyRzooc-lM/видео.html
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! ruclips.net/video/FxyRzooc-lM/видео.html
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!
Not a fix as the AI still looks off in other directions if oriented toward + or - X.
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.
my problem is that there is no asset details tab. im stuck on step 1. why dont i have an asset details tab?
@@errormachine5056 It's either hidden behind another tab or closed - try going to Windows > Details.
@@stephenmontague6930 thanks buddy!
My AI are going to be so fleshed out by the time i watch all of your AI videos. Thank you!!
That's great to hear man! So happy to help! :)
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! 😊
Thanks for another cristal-clear tutorial Matt ! This helped bringing aim offset to my clones & droids =D
jesus christ, i googled this and lo and behold Matt’s just uploaded again 😂
Hahaha glad to hear Google likes me lol
This is awesome!
Thanks a tonne bro!
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.
You are God, it is too simple. thanks
You've once again done a great job of explaining a useful animation technique. Thanks, Matt!
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?
Possibly yeah, I haven't messed about with UE5 and control rigs massively just yet, great idea though!
Thank You so much!
Always a pleasure to help :)
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.
omg that was easy, thanks
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
works perfectly thx
Thank for th tutorial! This save me a lot of headhache!
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!
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!
You are a legend!!!!
thank you sooo much
It's a pleasure :)
Can you do one on the character head rotation with the mouse-gamepad?
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?
ruclips.net/video/FxyRzooc-lM/видео.html (Works perfectly!! A quarter of the work, and can look up and down without ANY bugs!
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.
Know what scratch that, I had the Pitch disconnected on the Anim Instance Side lol
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
Hey matt not been here for a while haha pc has been broke😂😂
Trying to animate a tripod robot. Do you think this tutorial will work with that?
Amazing!!! I think I can use this to create a leaning aditive for my walk/run BS, thank you bro, you are the best!!!
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! :)
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?
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?
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?
Hey. this could absolutely be used for that yep. If I'm understanding you correctly, I made a video on this previously :)
ruclips.net/video/PZqzhGhANx4/видео.html
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?
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!
ruclips.net/video/FxyRzooc-lM/видео.html
Can you please make tutorial how to make isometric game?
Nice idea, I can look into it for the future
@@MattAspland i can't find anything about that on UE forum and YT
My ai does not look in the correct direction as my character. Can anyone help?
UE5 anim offset 1d wont budge at all. Don't know whats wrong.
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!!
poggers, love ya
All the best to you brother!
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…
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!
ruclips.net/video/FxyRzooc-lM/видео.html
Cool
tks Dude, its help me..
please make AI to attack us
Doesn't work in UE5 (at least for me)
Oooh so that's how.
Yeah more simple then you might expect! All the best to you :)
Doesnt work! Acessed none in YAW
Same here. did you find a solution? :)
@@KWang-yy2qk Dont work, i cant find a solution.
@@TonyDevGame
ruclips.net/video/FxyRzooc-lM/видео.html
Works perfectly!! A quarter of the work, and can look up and down without ANY bugs!
.
I'm so sorry i got hack by someone
Thanks so much! ❤
Thank you so much 💓
No problem at all man :)