New answers tagged

0

With the following model the client will render only what the server tells him to render. The client becomes an input & input-pre-emission-validator The server is the final-validator (don't trust clients) Then the client renders what the server told him [1] Client action request creation upon user input : Client clicks on an enemy, triggering your ...


0

You can use the delta variable of the render() function. This variable is a float value of the time elapsed since last render call (Something like time from frame to frame, not exactly, but this is the idea). Simply add the delta time value to a variable and then execute the code you want when the variable gets to a specific (or random number). Generic ...


2

// ORIGINAL TIMER COUNTDOWN IN SECONDS const float TIMER = 3; // TIMER CURRENT TIME float Timer; // RUNS ON EACH FRAME void Update() { // SUBTRACT DELTA TIME FROM CURRENT TIME Timer -= Time.deltaTime; // TIMER WENT OFF if (Timer <= 0) { //DO SOMETHING Foo(); // RESET TIMER Timer = TIMER; } }


1

Well, there is nothing obvious problem I can find in your settings but here is my recommended settings, so you can match it, may be your problems lies in between these. Text Object should be like, Canvas settings Game resolution should not be set to Free Aspect. Assign some resolution.


2

Use a timer with a decent resolution (such as QueryPerformanceCounter on Windows). At the end of your update routine, query the timer and store the result somewhere. At the start of your draw routine, query the timer again and compare the result to the value from the end of the update routine. That will tell you how much time elapsed between the two. This ...



Top 50 recent answers are included