Boolean values being shared, despite independent values? (SOLVED)


I’m working on a slight enhancement over the Fire Bullets behavior that gives me more control over it, and I’ve run into an issue.

See, I want to make it where the spawned bullets have certain properties when shot (E.G. color, animation, behavior, etc). For this example, I want the bullets to have a “friendly” behavior, whereas friendly bullets won’t hurt the player.

I have two debug testing objects spawning a bullet spawner object, which quickly spawns the bullets, then deletes itself. One of them shoots friendly bullets, and the other one doesn’t:

However, when I test it, this happens (Friendly bullets are tinted black for demonstration purposes):

I have no idea what’s going wrong here, considering the bullet’s lifespan works just fine. Unfriendly bullets are supposed to be red, but they’re ALL spawning as friendly shots??? For some reason, the boolean values are being shared instead of being independent.

You may notice that there’s a disabled function below. I made it previously, but I decided to deprecate it and migrate everything out of it since I can’t properly control the booleans from within it (The way I’m setting this up at least)

Is there a way to get the booleans to work properly?

Your problem lies with this event:

You are not defining or selecting which bullets to make friendly, so they are all selected and modified. If you want it to be applied to bullet created in the previous event, then make this event a sub event of the previous one, like:

1 Like

Mannn, I’m embarrassed by how simple of a fix that was, I tried everything EXCEPT that. Thanks for pointing that out, it works just fine now!