Variable with "actor as selected type" always returns null, why?
Ok so the variable Main is referencing an actor in the level. There is only one instance of that actor. Now I CAN read a variable "Counter Running" from it just fine but then I have to Set a variable I always get "Accessed none' as an error message once I return to the editor. So I know that Accessed none means that the variable is Null and contains but how can it be null if I have just read from it? I basically can read a variable in that blueprint but not write...
asked Aug 14 '15 at 09:17 PM in Blueprint Scripting
Have you tried doing the same but using a standard "Cast to" class, with your variable selected instead of Self?
I'm assuming you can see the variable because you've marked it as public, but doing cast to, you can set/get anything within a class without any issues that i'm aware of.
answered Aug 15 '15 at 06:46 AM
You only selected the Type. You said you know what "NULL" means, so you should know that you have to fill the variable before using it. It's weird that you can get any value of it. Fill the variable and only use it when it is not NULL or at least use an "IsValid" to make sure that you don't use it when it's NULL.
Your "There is only one instance of that actor" doesn't do anything. There could also be 2 or 0. You need to get the reference of this one actor and save it (set) to the variable. Otherwise you will get the Error.
answered Aug 16 '15 at 04:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here