I have pretty weird problem.
First i’ll explain what’s happening.
I have a character and in the MovementScript there is one function that is killing the player and moving it back to the last CheckPoint.
The function simply stops the player from moving, then deactivating only the geometries, not the whole gameObject of the character, so the scripts, can continue working. These deactivations and activations are separated by simple yields with 0.5 to 1.5 seconds.
There are holes in the game and when the player falls in them, he passes through a trigger, that simply calls the function that kills the player. It works just perfectly.
There are also characters, that shoot bullets in the game and when that bullet hits the player, it calls the same function, for killing the player. But when the bullet calls the Kill function it get’s executed just untill the first yield and then stops. So the player dissapears and doesn’t go back to the checkPoint.
There are no errors, no nothing. It just stops at the yield and happens only when bullet hits player.
The bullet have 2 public variables “speed” and “rotateSpeed”. I just found, that if i change the variable of the bullet, from speed, to bulletSpeed, the Kill function is executed untill the end.
So if i have 2 variables on completely different objects, that are public (Not Static), is that a problem???