While casting to a BP_thirdPersoncharacter it not dcasting it properly


this is my code struggling to make it aim lock the enemy,

Hey there @KirinStout! Welcome to the community! Where is this script running from? If this is the enemy’s BP, what is happening is that you’re calling to the current owner (the owner of the enemy actor itself) and trying to cast to a player contained there, which will always fail because this is not the player itself. Casting only looks at the context it is given, which in this case is just the enemy’s owner.

You could use Get Actor of Class for single player games, or the Get Actors of Class for multiple possible players.

If your enemies don’t have any senses/view range and you just want them to know the player globally, then you can keep your current setup and just lightly modify it.