1
\$\begingroup\$

Whenever I finish running the project, this error message appears:

enter image description here

Blueprint Runtime Error: "Accessed None trying to read property jogador". Blueprint: Jogador_BP_Anim Function: Execute Ubergraph Jogador BP Anim Graph: Transition Node: Result

By clicking to know where the error is coming from, the program tells me this code:

enter image description here

This is the code I made to get the player reference (jogador/player Animation Blueprint):

enter image description here

This is basically for the transition code between animations, to receive information whether or not the player is jumping (jogador/player Blueprint):

enter image description here

Animations perform normally, so the error doesn't seem to compromise project execution, but why does it occur?

I looked at some links, but I don't know how to remove it.

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/86607-accessed-none-trying-to-read-property

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

Do not ever dereference anything from any other classes In animation’s state machine. (You can dereference only in eventGraph).

First the reference may not be there yet when the animBP is running. Second, animBP state machine is designed to be multithreaded, but dereferencing any other class in BP is not thread safe.

TL DR: Do not use any bool variables from any other classes, all the state changing booleans should be within the animation blueprint itself.

Then set the booleans in anim’s BP EventGraph from any other class.

\$\endgroup\$
2
\$\begingroup\$

Easy fix, in the animBP Update Animation sequence, instead of checking pawn owner, check the player variable that is created by begin play. In this case labelled "Jogador".

The pawn will be available before the animation begin play can officially execute, so there will be a singular execution of the update before the required player reference is actually set. Checking the variable validity instead of the player pawn will ensure everything is set before updating.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .