Hi playcanvas community hope yall doing well, So I am a bit confused at what I am trying to do. The thing is I am trying to make a slow motion effect and make that effect last for given sec and within that time I want to spawn an entity and show it moving slowly. I have tried some things but it doesn’t work like I want so I need some help here. Here is a bit of code
the 'particles variable is spawning the particles in the game and timeScale is usesd to slow the game speed after lets say 10 seconds I want timeScale back at 1 for which the await call is used.
Having a quick look at the code, there is heavy use of awaits that rely on realtime rather than the scaled time in the engine. This will cause you issues further down the line as spawning of asteroids for example will not be affected by the ‘slow down’ time.
As for your current issue, I don’t understand the logic of it needing slowTime to be called every frame.
It should be called the once when it is needed and only in the frame that it passes the time.