Are timers still inconsistent, or could I be doing something else wrong?
Using a timer, I am spawning an instance of an actor once every second.
In this actor is a timer set to increase a self attribute by 1 every 0.1 seconds.
This actor begins moving as soon as it enters the scene. When it collides with another (stationary) actor, I display the value of that self attribute.
Sometimes that self attribute has a value of 7 at this collision, and sometimes a value of 8. The speed at which it is moving never changes. This value should never change.
If it's still an accepted fact that timers are a little inconsistent, I suppose I can just accept that and achieve the desired effect another way. If they are NOT inconsistent anymore, I will have to dig deeper to figure out what's going on.
What's the consensus on timers nowadays?
Thanks!
Comments
So if I understand correctly, two instances of an actor are moving at a set rate from the same location towards a stationary actor and they are triggering their collisions at 0.1 seconds apart from each other? I would think that would be possible depending on when each actor is firing its collision rule...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@Adrenaline
timers are a bit inaccurate at such short intervals.
Timing rules are sometimes more precise. Use the following:
The following illustrates timing fluctuations under certain conditions:
These are ticks dropped (spawned) in place from a moving actor.
In my experience the timer behavior is much more susceptible to other happenings in your game, than timing rules.
That said, your difference in results is also likely a result of rounding problems, due to when the game detects the collision.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
I'm not sure how or why (or maybe I'm imagining something) but ever since custom collision shapes were introduced in creator 1.24, I've had constant issues with timers. Really hope cc shapes might be reviewed by GS team when they go back to working on the engine.
Thank you @Hopscotch , that pretty much says it all.
Apologies for the confusing explanation. You've got it mostly right. I'll try to explain again, just for clarity's sake.
Spawn actor A at the center of the screen. It moves with a set speed towards a stationary actor B. In actor A is a timer that increases a self attribute by 1 every 0.1 seconds. When A and B collide, I change a rule that stops the self attribute from increasing, and I display that self attribute. It shows a value of 7.
I do all of the above again, and sometimes it shows a value of 7, sometimes a value of 8. The locations, distances, speeds, rules are all identical in both cases. Therefore, I began to question the accuracy of the timer.