Timer not consistent
Hi Guys and Girls,
I'm a complete noob here building my first game so please go easy on me!
I have a problem with a timer not being consistent. I have my game set up as iPad portrait and I have the background continuously scrolling from the bottom to the top (-270). I've set up a controller to spawn a 'goal' actor at every 1.5 seconds and these goals move in tandem with the scrolling background. (Think Flappy Bird for the effect I'm trying to describe).
Now my problem is that the first 4 goals all spawn correctly 1.5 seconds apart and move at exactly the same speed as the background but after that they spawn much more frequent and out of time so that after roughly 20 or so seconds my preview screen is filled with goals with differing gaps.
Is this a common problem that I'm encountering? If you need more details please tell me precisely what and I'll provide them.
Thanks in advance!
N
Comments
Can you provide a screen shot of your Timer Behavior? It sounds like something is effecting the timer for some reason.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Sure thing, here it is:
@NattyBits -- Try turning off run to completion.
Having it checked means that spawning continues even when (game.Playing) becomes false. And if it then becomes true again, you get another timer thrown in, so in essence you suddenly spawn twice the amount of goals you want.
@phghost - I just gave that a try but it didn't seem to make any difference...
Nothing seems strange there. Could you have another rule spawning goals that you forgot about or maybe an instance in the scene is doing something that is not showing up in the prototype actor?
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@jamie_c They're the only rules really. I just started again, deleting the controller and goal and I still get the same issue when I use these settings.
Maybe it has something to do with the way that I'm spawning my background? I've attached two screenshots of the background spawn settings, maybe you could have a quick glance over them? As previously stated thisis for iPad portrait and I have the background scrolling from bottom to top (-270).
Thanks for your help so far!
Hi All
So I've been playing around with this lots today and I've found a solution to the timer but this solution breaks my scrolling background.
To fix the timer issue and to make all the goals spawn at perfect 1.5s intervals I simply unchecked 'Wrap Y' in the Scene settings. Perfect.
But now my scrolling background will not spawn another copy after the initial one so the goals are being spawned onto a blank background!
Does anyone know of a way around this before I pull all my hair out haha?
Thanks!
N