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:
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 can’t upvote because i get a popup that says: “Request method not allowed” in chrome, firefox and ie.
I also don’t see any button to accept an answer.