Received blueprint runtime error accessed none trying to read property.

I already refence the variable from the cast as I set it as variable but turn out the variable default value empty.

The empty default value is expected. After all, you are storing an instance, therefore, it will only exist when you run your game.

Hi @zeriy, Welcome to Unreal Engine Forums!

The reason why the default value is empty is because you made a variable, but did not give it a value. In coding we call this declaring a variable. Basically means that you made a variable and gave it a name, but did not give it a default value. So since your variable is empty it means you declared a variable but not initialized it (give it a value).

In Unreal Engine, if you set a variable via blueprints, then that variables default value will change or update during runtime so that’s the reason why it’s empty right now even though you set it.

For Animation Blueprint, we typically don’t set a default value so that part should be empty.

Based on the title, your getting a runtime error and I’m going to assume it has something to do with that variable in the image. I could think of two reasons why your getting the runtime error.

  1. You tried to access information from the variable even though the variable is invalid. You should always make sure your variables are valid by using the “Is Valid” node and if the variable is not valid then don’t run the code.
  2. Your cast failed. In image, your casting to “ABP_Knockdown” and maybe that Animation Blueprint failed to cast so your variable was never set. Add a print string to the cast failed to check if the cast failed or worked.

Hope this helps! :+1:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.