Tiger once while true cause problem in pause system.

I am trying to create pause system, since I want the scene to stay, instead to go to the next scene. As to give some options Like “save game” on check points… Every thing is fine but tiger once while true is creating a problem. Example : If you hit the enemy and this enemy takes two hit to die, but if you have paused the game and play it back the enemy dies with just one hit. And guess why because the condition became true again. And if you are really fast at hitting the button you might be able to kill the enemy, that take 3 hits, with just one hit… and also I don’t wanna use variable every where I used TrigreOnceWhile condition. Any other way to fix this issue, except using pause the scene and go to the next? :confused:

Please send some image of the event of your project? especially on the attack :slight_smile:

There are sooo many events so I am going to upload two pics

Here is the second. It is the same Logic for attack the entire game uses.

It’s hard to pin point the problem, ill analyze it further…

For now, here is a suggestions :smiley:
When you pause the game set the PLAYER to another position(maybe just the y position outside the game window) this will prevent the collisions that may damage the ENEMY, set the previous position when resuming the game is resumed… :laughing:

Sorry for the english… haha, im typing on the phone, i didnt check what im typing… :blush:

I’m not sure if I can offer any help but just to clear things up, what you mean is that if you pause the game (set pause = 1 and playgame = 0) at the very moment of the collision with the enemy, even though it would require 2 or 3 collision (hit) to kill the enemy, the enemy get killed by the single collision triggered at the moment when you paused the game?
Or do you mean if you pause the game anytime, after the enemy get killed by a single hit no matter what?

Could you please try something and add a variable for debugging purposes and increase the value of the variable by 1 to count the number of collisions and the number of times the enemy health is decreased and display the value of this variable in a text object.
Try it in this event both places:


first in the parent event when you check for the collision to happen and after try it in the child event when you decrease the health of the enemy and see what the numbers are saying…

First Let me clear myself. When I hit the enemy (if frame is >=3 and <=5) the health decrease, let’s say 5 units. if I pause at 3rd frame and play, it decrease 5 units from health again and if I pause again it play it again, before 6th frame, it decrease 5 units again. So I think that is pretty much clear.
Second if I add increase 1 to the variable “CheckCollision” in the first (Parent) event. It will keep adding 1 until the attack is over. So what do you want me to exactly do?

Oh I see. If you want to cause damage only once on each collision it might solve the problem if you would change the order of your events and start with collision check then check if the game is paused then damage the enemy:
image.png

Or if you want to cause damage once every time the animation is >=3 and <=5 then try that first then check if game is paused…etc
image2.png

thanks dude