How do I measure time between two events?

0 favourites
  • 2 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)