My timers aren't working

I am trying to make a multiplayer tag like game, where you try to run from the tagged player. I use timers to determine how long the tagged player has been “IT”. if they are for a certain amount of time then they die and the “IT” is given to another player while at the same time deleting the previous tagged player until there is one left.

my problem is after two of the players die then the timers would stop working and the code would break. does anyone have any idea why this is?

please say if this doesn’t make sense or if you need a screenshot of the code

Hi, a screenshot would be very helpful.

the code is when one of the “IT” collides with someone else it will start that players timer. and as previously stated, after a certain amount of time the “IT” will die. but the code just doesn’t work after two players are deleted. whenever one of the players dies, it will assign a random value to a certain variable and to do the corosponding action
Also, each player has a certain tagged player for the sake of easy coding on my part.
i hope this helps, if not then just say.

The events that include your timers are not in the posted screenshot.

Crap wrong one, sorry

Okay, it would be also necessary to see how you initialize your timers (your collision event) and under which conditions you reset them.

the code is the same for all collisions with all of the players,
the code is if the tagged player collides with one of the players then start the player timer and pause their timer.
hope this helps

It is still difficult to say what is going on because not all timer events are shown - I guess.

Do you unpause the paused timers somewhere? As far as I understood the player has 3 seconds time to give the state to another player and after getting the state back, 3 seconds start again, right?

yeah, but the 3 seconds is just for the sake of easy testing, it goes much faster with 3 seconds as opposed to 20-30. also when a tagged player collides with a regular player the tagged players timer stops/pauses and the person who got tagged, their timer starts/resumes. the type of code for the collision is the same for every collision just specific to the players who collided.

Probably this is not what you want, but since it is difficult to look through the events and figure out why your timers don’t work, I can give you an alternative solution. Maybe it can help you to fix your events.

In the example below, I use a players-object group so that I don’t have to make all the collision-events for each player again. To make things easier, I check the collision between tag and player instead of player with player. I also use object timers.

Since I have no setup for multiplayer, I just activate or deactivate the topdown-movement for the tagged or untagged player. The tagged player can move around and tag the other player-objects in my scene.

There might be some parts that can/should be improved but at the moment it works: the tagged player gives the tag to the next player after collision and the tagged player will be deleted after 3 seconds, if the tag is not transferred to another player within that time; if a formerly tagged player is tagged again the timer restarts from 0.

thanks for the suggestion, i will try that