Unreal Engine 5 (ALSv4) - Proper Headtracking Tutorial
In this tutorial I will show you how to adjust the "Look At" behaviour of the AI's in the Advanced Locomotion System to look at the target's head instead of their Origin point. Please keep in mind that this is using the ALSv4 Base Project, which already has some LookAt behaviour built-in. Some things I forgor to mention in the video: 1) The new actor HAS TO BE of type "Character". If not, the NPC's will only look on the horizontal axis for some reason. If you notice the character isn’t looking up or down at you, check if this is the case. 2) Even though the "SetFocus" function uses an actor's location to then call "SetFocalPoint", we can't use the SetFocalPoint Function here to do something like Get Player Character → Get Actor Location → Add X0 Y0 Z150 to get the characters to look up, as this will lead to choppy animations and turning while the character is looking at you. 3) If you have a more advanced AI setup, the AI can sense this actor in the Sight sense category. In order to prevent this, you can add an actor tag like "NoAISense". Then, before your AI determines its target to attack/investigate/etc., run a branch with "Actor Has Tag" to prevent actors with this tag from being sensed. Software used (in order): Unreal Engine 5 Some inspiration: You could make an Enumerator with multiple entries such as "Head", "Chest", "Feet", etc..., then spawn multiple of the "LookAtEyesActor", attach them to the respective bones or sockets, then inside the interface function, add the enum as an input. Next, inside your basecharacter, find the implemented function and run a select node off the enumerator, and connect the output to the return node. Set the select node inputs to their proper spawned LookAtEyesActor references, and set an input inside the BehaviourTreeTask as well so you might set this based off of certain conditions. If you need help making ^this^, let me know! I will happily make another tutorial for you, where I’ll dive deeper into this functionality.
Download
0 formatsNo download links available.