Disable Specific member in GetAllActorOfClass array
Hey everyone !
So, basically, what I'm trying to do is (I think) qutie simple. I have multiple "zones" where I can do actions in it (spawn an actor). Once I have exectuted this action, I want to disable the posibility to do the action again (prevent double spawning).
So the setup I have tried is I register an index for the zone, and when I overlap the zone, I set the ZoneIndex in my player pawn. Problem is, it is working, but the getAllActorOfClass does not seems to feed the array in the order the zone have been created, but rather a random order, so even with my fixed index, it disable interraction, but not for the current zone.
My question is, how would you manage this ?
Thanks for anyone who is able to help !
asked Mar 27 '19 at 02:29 PM in Blueprint Scripting
Hi you could use "do once" to avoid double spawning. The issue with "get all actors from class" is that they are random, to solve this issue you have to add the actors on spawn to an array, for example inside your Player controller.
answered Mar 27 '19 at 02:39 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here