How to make ThirdPersonCharacter look at NPC?
The most important thing is, in the ThirdPersonCharacter Animation Blueprint, how to get the position of NPCs?
Usually, you’d get the look at target position from owning character.
So in anim bp get a reference to owning pawn and get the desired location.
Hey there @YuWong! Welcome to the community! I’ve got a quick tutorial on hand:
Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.
Thanks. It’s better to be more specified, I’m totally a noob
I want the Character look at NPCs near by, not the NPCs look at the Character. The latter is much easier because we can just use “get player position”
Implementation for your case will be almost exatly the same, the difference is how to get reference to NPC.
If you are new to UE, propably the simplest way would be to get overlapping actors around the player. You can do it by adding Sphere Collision Component to player bp and bind to its Begin Overlap Event. Then you can check if the overlaped actor is actually NPC, and if so: store it’s location.
In Anim BP take this stored location and use it as shown in SupportiveEnitty’s tutorial.