Access Actor variable from level blueprint
This is based on the sidescroller template.
What should happen is this:
When 1 is pressed, get all people actors and for each of them print the name to screen & check if the variable "Right" is set. If Right is set move to right target if not move to left target. However my "people" always move left and i get the error "Error Accessed None 'PeopleBP' from node Get All Actors Of Class in blueprint SideScrollerExampleMap" after i hit play and exit again :(
"People" is a child of the Sidescroller character:
My variable in the people blueprint looks like this:
It's exposed at spawn and set to public
I really don't know why it doesn't work :(
I would appreciate any idea! :)
It doesn't look like you are assigning PeopleBP any value, at least in the provided screenshots.
Are you setting PeopleBP to anything?
answered Mar 10 '15 at 09:50 PM
In general "Accessed none" means your reference is invalid so check where it tells you it's broken.
In this case we have "Error Accessed none "PeopleBP"". That tells us quite a lot. In this script we have exactly one node called PeopleBP so we don't even have to find out which one is meant. You want to check "Right" for each "People" actor. The variable PeopleBP however references simply an actor which you don't set in this script.
I highly assume you never set this variable at all and it's just an empty reference.
...so the very simple and easy fix is to just use the output of your "Array Element" from the ForEachLoop for your "GetRight" (the boolean). You might have to cast it to "People" first which you can do via a simple "Cast to People" node and use the output of that.
I hope this helps.
answered Mar 10 '15 at 09:52 PM
Cast to people worked fine! Thanks again! :D
answered Mar 11 '15 at 05:19 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here