Questions tagged [timer]

A way of measuring time intervals for the purposes of triggering an action after some elapsed time.

Filter by
Sorted by
Tagged with
0 votes
0 answers
62 views

How to detect when console system time was changed since the game was last run, without a net connection?

As an example of the behaviour I want to implement in my game, look at Bloons TD 5 on the PS4/PS5 and its Daily Chest Reward. If you disconnect the internet and change the date and time and play the ...
CodeCamper's user avatar
1 vote
1 answer
111 views

How to pause or slow down/speed up Time.deltaTime when it is inside the Update() method?

My player is able to dive for a limited amount of seconds (let's say 10 seconds) while swimming. When he's not diving his breath gauge fills up again to a max of 10 seconds: ...
Tomo's user avatar
  • 133
1 vote
1 answer
215 views

Making a countdown time readout in Godot 3.1

I wrote this script to design countdown in my game: ...
Nina Monti's user avatar
0 votes
1 answer
81 views

Timer for each level godot 3.1

I want to set a timer for each level of my game, so that when the player eats item number one, 10 seconds will be added to the time of that level, and when the player eats item number two, 5 seconds ...
Nina Monti's user avatar
0 votes
2 answers
499 views

Cooldown in the new input system of unity

A few days ago I first used the new input system of unity for my game and I ran into a problem. So basically I cant seem to figure out how to implement cooldown in the new system. Either it just ...
Hammynator's user avatar
0 votes
1 answer
422 views

How do I implement a countdown timer for a multiplayer chess game?

There's a lot of multiplayer games out there that uses countdown timers to set a time limit in their game sessions, but how is it actually implemented? For example, in a chess multiplayer game based ...
Yago Biermann's user avatar
0 votes
0 answers
43 views

Strategy browser game - Update tables on refresh

I am building a Travian clone for learning purposes using FastAPI for the backend. I want to update my current logged user tables whenever they are making a new request (such as loading a new page) ...
Pierre-Alexandre's user avatar
0 votes
1 answer
241 views

Script not working on object in unity 2D

I was following a tutorial where the gameobject was to spawn randomly within the screen. The code I used is as follows. ...
Rohit Krishnan's user avatar
0 votes
0 answers
40 views

WebRTC - Protocols and Getting the Timing Right in a Racing Game

I am trying to work out the protocols to set up a game between 2 players and the ideas behind getting the timing right between those two players in a running race game. Since this is obviously a timed ...
Rewind's user avatar
  • 113
0 votes
0 answers
155 views

Solution for efficient time-keeping in Javascript games?

I'm developing a real-time browser roguelike using an ECS and currently I'm unsure of how to handle time. As of right now, whenever I need the current time, I just call ...
Ryan Peschel's user avatar
0 votes
1 answer
74 views

Why does my spawner spawn multiple times at start-up, only in build?

I'm making a small game similar to Super Hexagon. I've recently asked a question about making the game harder as the player progresses by increasing the obstacles' spawn rate. I was able to implement ...
Ali's user avatar
  • 55
0 votes
1 answer
491 views

How can I increase the spawn rate and speed after some time?

I'm working on a Super Hexagon-like game and the goal is to survive as long as possible. The game is working fine but I want to add a new feature that increases the spawn rate of the obstacles and ...
Ali's user avatar
  • 55
0 votes
0 answers
664 views

Fixing the frame rate for SDL2 2D game

Working on a 2D game with SDL2, for now on Window, but I'd like to dream and imagine that if I finish it, I could run it on other platforms that SDL2 games can target. A core part of which is GGPO ...
Tom Davies's user avatar
0 votes
1 answer
181 views

Timers: check in game loop, or run independently?

Specifically talking in the context of JavaScript game development. For example, I can use the language specific timeout mechanism: ...
Adam Arthur's user avatar
-1 votes
1 answer
477 views

How do I save my Highest Time for each level on playerprefs?

So I want to make hill climb wanna be game but have an issue with saving bestTime each level, the point is I want to save the best time for each level to ...
YouCanCallMe Syarif's user avatar
0 votes
1 answer
111 views

Time-passed check with Pause functionality

I am working on a game that has a lot of time-passed checks of the following format. These work great, but there is a problem when the game is paused: If paused for any meaningful amount of time, the ...
Ben's user avatar
  • 487
0 votes
1 answer
558 views

Calling function every n second javascript game

I making a game and I want to call a function that runs every random second to spawn something every time. I've seen some posts that said to use the setInterval() ...
NiJuice's user avatar
1 vote
1 answer
129 views

Reacting to button holds of different durations for an anxiety game

I am working on an interactive game to aid with anxiety management. In one of the gameplay options, the player has to press buttons for a certain amount of time. Only after the required time has ...
user19964's user avatar
  • 105
0 votes
1 answer
470 views

How to make a countdown timer based on local time

I have a problem. In my GetTime.cs script, I am getting local time from an Android/iOS device, and simply assigning it to a Text component. ...
Seweryn Pokutycki's user avatar
2 votes
3 answers
205 views

Multiple events based on in-game timer?

I've been thinking about how Zelda: Majora's Mask manages all its character events during the day and thinking about the best way to implement this. Initially I thought of each character entity ...
Forumpy's user avatar
  • 121
0 votes
0 answers
159 views

Proper way to handle timers at scale

At scale for multi-users, what is the proper way to implement timer updates? I'm making a game where Users have buildings to upgrade which involve timers (Yes I know there are plenty of questions ...
ChrisW's user avatar
  • 1
2 votes
1 answer
5k views

Phaser 3 - How to trigger an event every 1 second?

I have just started learning Phaser 3 and making a simple idle game, where you would gain x resources per second. What is the best/recommended way to do something like this? The two main ways I have ...
lozzajp's user avatar
  • 780
1 vote
1 answer
544 views

Why is the timer not calling the function?

I am trying to call a function every 30 seconds. I have used this before without issues so I'm not sure why it isn't working now. Any ideas? Has something changed in 4.24 maybe? .h I have tried both ...
Jason Crosby's user avatar
0 votes
1 answer
444 views

Execute Timer Events of another Blueprint from the C++ UE4

I am having problem and it's about a week now that I still can't figure out how to get it right. It seems that I can't run any functions from the blueprints that contain timers at all. I have a ...
Mira's user avatar
  • 139
3 votes
0 answers
147 views

Quake 1: frame timer

If you check Quake 1 source code (sys_linux.c), you can see something like this: ...
user1095108's user avatar
1 vote
0 answers
185 views

Using a timer in conjunction with two push buttons from Arduino input

noob here So I am using two push buttons (connected to an Arduino Uno) as an input to my game. The player has to push down both buttons at the same time for the character to move in the game. I want ...
user19964's user avatar
  • 105
0 votes
3 answers
1k views

How do I blink a sprite a few times before it disappears?

I need the 3d poop emoji model in the chest on the right to blink, visible-invisible-visible, several times: This is a 3d gameObject oriented to face the camera, shaded with an unlit material. I ...
hatinacat2000's user avatar
0 votes
1 answer
252 views

Timed Events in a Unity WebGL game with a PHP / MySQL Server

I want to make an online WebGL game with Unity with button based interaction. So far I have my login and registration system, with some tables in MySQL to deal with that kind of stuff. Next I need ...
Somberlain's user avatar
1 vote
1 answer
107 views

Timer breaks after changing scenes

I am using this script below to move an animation in unity with no root-motion. It simply walks across the terrain. I have timer attached also so the animation doesn't start to walk for 60 seconds. ...
patrick's user avatar
  • 37
0 votes
2 answers
1k views

the countdown timer inside while loop not working [duplicate]

i am instantiating prefab cars ... the clones had a random countdown timer with each one off them and its working very well but the its not decreasing its not counting down the timer is inside the ...
Mr Salsa's user avatar
0 votes
1 answer
1k views

Use vsync event instead of a 16ms timer?

I found that in game development, most people set a timer that gets triggered every 16ms to do the rendering. As an Android programmer, I'm familiar with the Choreographer. You set a callback that ...
ravenisadesk's user avatar
0 votes
1 answer
2k views

How to spawn enemies after a certain amount of time?

I wanted to spawn different enemies(meteors) after a certain amount of time this is the script that I tried doing but it's giving me an error. I'm still just a beginner and I don't if I did something ...
DeeMastah's user avatar
0 votes
0 answers
330 views

Duplicate packets and termination of packets in multiplayer game

I'm making a multiplayer game (lazertag) with real hardware. After hours of research, I'm choosing the UDP instead of the TCP protocol to exchange data. Because of how unreliable UDP is and because ...
Mike -- No longer here's user avatar
1 vote
1 answer
2k views

Unity3d Pause RigidBody object, don't stop time

Time.timeScale = 0 obviously works to stop physics but it's also stoping my Invoke calls. How can I get around this to pause ...
Jacksonkr's user avatar
  • 229
0 votes
1 answer
1k views

Unity C#: Accurate MachineGun Firerate at lower FPS

I have long accepted that my firerate will be more or less irregular and inaccurate. Now that I'm adding sound things are getting really ugly. My methods for getting the firerate are primitive and I ...
AzulShiva's user avatar
  • 669
2 votes
2 answers
164 views

Timer as part of a condition

I am using a sensor as the input to my game. When a certain level of force is exerted on the sensor, for a certain amount of time, I want the next level to be reached. How would I do this? I have ...
user19964's user avatar
  • 105
2 votes
2 answers
786 views

Time based events separate from the game loop

How can set up time elapsed based events separate from the game loop? I want the character to heal over real time rather than per cycle of the game loop. How might i do that?
Richard Carpenter's user avatar
0 votes
1 answer
1k views

Start timer when button pressed (what is wrong with my code?)

I want a timer to start when my rocket takes off and stop when it lands. Stopping works fine (using a collider and state-switching) but I can't get the timer to start when I press the boost button. ...
Sam Luxton's user avatar
1 vote
1 answer
291 views

Saving total play time could be fine?

I'm making a game that needs to save total played time into file (using JSON) for comparing & resolving data conflicts between local and cloud. I will override outdated one. Currently, I'm just ...
modernator's user avatar
  • 1,213
2 votes
1 answer
177 views

How to structure a game that continue even when closed?

I'm developing a Unity based game purely for fun but I'm stuck with a problem. How can I implement a system that keep my game running even when is closed? I don't want to HAVE IT running when it's ...
pava's user avatar
  • 21
1 vote
1 answer
1k views

Is Time.deltaTime different on various devices?

Can someone say what is wrong with my code. I have custom timer implemented like this: ...
blablaalb's user avatar
3 votes
2 answers
103 views

To implement a game object that expires, should I store the start time and total, or store the remaining time?

Example: There is a bomb (like in Counter Strike) which explodes after 45 seconds. Should I— store the 45 seconds in a variable, and decrease it by the delta time at every update, or store the time ...
user's user avatar
  • 257
1 vote
1 answer
107 views

Prevent parent alarms to activate a child alarm event

I'm working on a small game using Gamemaker Studio 2 and I've noticed that my Parent o_enemy.Alarm[0] Is activating the Child ...
Steven's user avatar
  • 891
1 vote
1 answer
2k views

Keep the timer counting after changing scenes

In my game you have 2 minutes to finish the whole game and after searching for an answer to my problem I think I should use DontDestroyOnLoad but I can't understand ...
clarex1929's user avatar
5 votes
1 answer
664 views

Precision timing in Unity3d

I am trying to implement a method which should be called each 10ms with a precision not less than 0.1ms (better 0.05ms). This method is very complex and it is generating sound samples which are placed ...
Epsiloncool's user avatar
4 votes
1 answer
611 views

Game time and pausing

I am writing a simple game where some things happen after some amount of time. I used simple time analog of the framework I use to schedule these events, however, I have found that I will not be able ...
VP.'s user avatar
  • 393
1 vote
1 answer
517 views

How to stop an anmation and a loop in relation to a timer? Phaser javascript

I am not ajavascript or phaser expert, I just got stuck with this problem. I'll try to explain it. In this game; is a 21 second timer in all this: which starts AFTER a beginning 3 second animatiton. ...
DjangPhaser1's user avatar
1 vote
2 answers
801 views

Make timer for game to run for 2min

I'm trying to make a game using C++ (in Visual Studio 2015). I want to make the game run for X minutes and then end. I have a function play() that calls all other ...
Varun's user avatar
  • 11
1 vote
1 answer
773 views

Fixed timestep updates with a variable timestep update

Many suggest that a game loop looks something like this. See: http://gameprogrammingpatterns.com/game-loop.html http://www.koonsolo.com/news/dewitters-gameloop/ https://gafferongames.com/post/...
goodpoutine's user avatar
1 vote
1 answer
206 views

Accounting for drift between ticks

What are some solid techniques to account for the gap between processing time and frame update ticks? In other words, the game/render loop looks like this: Some important points: Tick timings are ...
davidkomer's user avatar