calculate timing while touching the object

Get help using Construct 2

Post » Fri Nov 01, 2013 2:55 pm

I would like to know how can i calculate hold timing of an object , suppose if user hold any object and don't let it go then once he leave the object i see the exact time duration he has hold it. Maybe it's common question but i am unable to find the answer plus i am newbee in construct2...

B
9
S
2
Posts: 108
Reputation: 1,010

Post » Fri Nov 01, 2013 2:59 pm

Player is holding object, every 0.1 seconds add 0.1 to a variable?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Nov 01, 2013 3:02 pm

Use a instance variable, timetouched.

then your event:
object Is dragging: add dt to timetouched

is touching object would probably work as well as condition. timetouched will store the time it got touched. Don't forget to set it to 0 again somewhere if you want it to reset.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Kin, ratboy3, takamoto, tinhofiel, Yahoo [Bot] and 34 guests