I am working on a simple fire fighter game where I have a blueprint that spread fire when it is in contact with another BP. I am trying to create an event to end the game when all fire has been put out. I am using the method of getting all actor of class and a for each loop to check if the BP are still ‘on fire’ by checking if each BP sitll have a boolean of true. I am not sure how to convert the returning variables to an array. Or maybe I am not using the right method for this.
I am trying to create an event to end
the game when all fire has been put
out. I am using the method of getting
all actor of class and a for each loop
to check if the BP are still ‘on fire’
by checking if each BP sitll have a
boolean of true.
Many ways to achieve this goal, if you want to to use the GetAll node for this, you could approach it like so:
No need to check all objects; if at least one object is still on fire, we can break the loop early - our firefighting task is clearly not complete. This makes the whole thing a tad more efficient, especially when we have 1000 things on fire…
I am not sure how to convert the
returning variables to an array.
Not sure what you mean by this. You want to store booleans in a separate array? There seems to be no need if the goal is to check whether there’s any fire to put out left.