I've been developing a game and came across a strange problem.
I have various instances of object "computer". Now whenever they have line of sight to "player" they shoot towards the player. They all show after every X seconds . Now shooting actions are placed inside a function. so this is like whenever see the player, every X seconds call the shooting function to spawn a bullet. This all works fine.
The problem arise when more than one instance has same number of seconds to call the shooting function. In this case when more than one instance has same number of seconds to call the function, then ONLY one of the instance call the shooting function. I don't know why.
As in the above image, when each computer calls it different seconds, it works fine. But if for example two computers have the variable activeGun = 2, then this won't work. Only one of them calls the function