How do I make an object to appear for x secons

Get help using Construct 2

Post » Wed Jan 28, 2015 10:58 pm

How do I make an object to appear for x seconds after a button press and when the x seconds ends the object disappears ?
B
5
S
1
Posts: 22
Reputation: 417

Post » Wed Jan 28, 2015 11:59 pm

Create a global variable called Timer and Every 1 second -> add 1 to Timer

Example (If you only need to set visible/invisible)
While Timer is >=0 AND While Timer is <= X ---> Set visible
Else ---> Set invisible
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Thu Jan 29, 2015 7:09 am

As an alternative you could add the Timer behaviour to the object. Make the object visible, start the timer, and on timer complete, make the object invisible.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Jan 29, 2015 10:06 am

use timer like so
You do not have the required permissions to view the files attached to this post.
B
245
S
39
G
15
Posts: 1,946
Reputation: 40,276

Post » Thu Jan 29, 2015 10:21 am

not sure what you want to use this for, but it appears to me that using the following actions would be easiest:

Spawn object (or set visible)
wait x seconds
Destroy object (or set invisible)
B
12
S
1
G
1
Posts: 34
Reputation: 591

Post » Thu Jan 29, 2015 11:55 am

Mathijs90 true all you do is use timer the way I used it in demo
B
245
S
39
G
15
Posts: 1,946
Reputation: 40,276


Return to How do I....?

Who is online

Users browsing this forum: alextro, ivanski1983 and 9 guests