Error with setting a float in Animation blueprint. how do i fix?

I added a variable named “angle” to a new animation blueprint inside an NPC then i want to change it based on dot product from the NPC’s actor forward vector and the vector that is from the NPC to to the player.

after i close the game i get this error

Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetPlayerCharacter_ReturnValue”. Blueprint: NewAnimBlueprint Function: Execute Ubergraph New Anim Blueprint Graph: EventGraph Node: Set angle"

why is it showing error? and how do i fix it?

This is just a suggestion, but you could try checking if the return value of GetPlayerCharacter is valid before trying to access its properties.

it helped! Thank you Elias

To avoid the crash, try checking if the return value of GetPlayerCharacter is valid before trying to access its properties.

That’s good to hear! :slight_smile: I’ve also posted it as an answer so that it’s clear that this question has been solved.