How do I measure time between two events?

Get help using Construct 2

Post » Thu May 04, 2017 11:04 pm

Hi everyone! I'm new to C2 and I find it very interesting
However, I have a problem with time: How to measure between two events? In more detail, I want to measure time between repetitions of collision
Thanks so much for any response!
Posts: 3
Reputation: 231

Post » Fri May 05, 2017 4:06 am

You'll need a counter variable, and a state variable (Boolean instance variable would be good).

On collision with object and statevariable is false, set statevariable to true, and set countervariable to 0.

The next event should have the conditions system else, on collision with object, and statevariable is true, then set statevariable to false.

In the last event event, if state variable is true, set counterrvariable to countervariable+dt.

The time elapsed between your collisions will be available as countervariable.
Mistakes were made.
Posts: 1,930
Reputation: 73,837

Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot] and 6 guests