Hey! So for my game i need an object to spawn between 1 second and 2 seconds. So i tried this and doesn’t seem to work.
local spawnRate = 1000 local function spawnObject() --Does different things here. Removed for better understanding. spawnRate = math.random( 1000, 2000 ) end timer.performWithDelay( spawnRate, spawnObject, -1 )
So the first time it spawns after 1 second but then it keeps spawning at 1 second. The math.random picks a new number but it doesn’t apply it to the timer.
–SonicX278