Overlaps & Collide won't change bolean
amigoni
Member Posts: 78
When you have overlap or Collide with another actor change a bolean variable from true to false or viceversa. It doesn't seem to work. It works well with other behaviours such as change attribute or speed.
Comments
Gendai - please fix this!
@amigoni You are probably seeing an issue with boolean because it sees a collision/overlap event, so if your rules inside checks if the boolean is true, then it changes it to false, but then it sees that the attribute is false, so it changes it to true...etc. It would be best to use just the Change Attribute behavior using an integer as the flip switch.
@scitunes I've tried this on every type of attribute with both it being movable and not movable. And it seems to work just fine for me.
I had a zombie actor that was eating the brains of another actor. I wanted to be sure that this only happened when the hands of the zombie were over the victims head so I had the zombie spawn an invisible actor that overlaps with the hands. The rule was when inv actor overlaps with victim do blah blah blah. Well both the victim and the spawned inv actor were set to non-movable. Once I changed the inv to movable everything worked fine.
if a = 1, change a to 0
if a = 0, change a to 1
is the same as:
if a = true, change a to false
if a = false, change a to true
I feel like I'm missing something... Thanks!
game.Switch = 1 - game.Switch
Rules that are active will continue to check values.
Analogy:
Take a normal coin. When you are told to flip it over, you just flip it over. You don't say, is it heads? Flip it to tails. At the same time you are checking if it is tails, you flip it to heads.