destroy an object after being created....

Get help using Construct 2

Post » Fri Oct 18, 2013 10:15 pm

hello there..i love making projects with construct 2..it is so awesome :))
but right now i have a little problem...
i want to make an object disappear(destroy..ecc..)after i made it appear by clicking the left button of the mouse...
so...
left click-the object appear-after that disappear..
(im making an action game so the object in question it's a muzzle flash attached to the image point of the gun :) )

thank you for your help :)



A.P.
B
10
S
3
G
1
Posts: 28
Reputation: 981

Post » Fri Oct 18, 2013 10:21 pm

Can you be more specific?
add an image.
B
48
S
9
G
10
Posts: 200
Reputation: 8,258

Post » Sat Oct 19, 2013 1:46 pm

right now i cannot post images because i don't have enough reputation points... i try to explain a little better
i click on the mouse= an object is created and then destroyed
thanks for the help :)
B
10
S
3
G
1
Posts: 28
Reputation: 981

Post » Sat Oct 19, 2013 2:15 pm

Use the fade behavior on it.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Sat Oct 19, 2013 2:28 pm

You could also use an animation on the gun. First frame without flash. When you want the flash, just play the animation.
B
13
S
4
Posts: 67
Reputation: 1,270

Post » Sat Oct 19, 2013 4:26 pm

Alternatively, you can use "On animation finished" or "On frame changed" then destroy
B
98
S
35
G
29
Posts: 3,139
Reputation: 28,396

Post » Sat Oct 19, 2013 4:58 pm

You might not be seeing it if it's instant (in the same event).

Try On Click, create object, system>wait 0.5 seconds>destroy object

It should show up then. It would be better to do fading and such, but getting it to just work is most important.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Sat Oct 19, 2013 11:15 pm

[QUOTE=C-7] You might not be seeing it if it's instant (in the same event).

Try On Click, create object, system>wait 0.5 seconds>destroy object

It should show up then. It would be better to do fading and such, but getting it to just work is most important.[/QUOTE]



@C-7 I would replace 0.5 with dt, it's better
B
98
S
35
G
29
Posts: 3,139
Reputation: 28,396

Post » Sun Oct 20, 2013 12:50 am

thank you a lot guys ^^ now is working but..there is a new problem now...
if i move the player and shoot, the muzzle flash will stay behind the player for a bit.. like:
move constantly right--click on the mouse--the object appear BEHIND the player. i cannot post images so... sorry if im explaining it a little bad...
again thanks a lot
B
10
S
3
G
1
Posts: 28
Reputation: 981

Post » Sun Oct 20, 2013 1:06 am

the easiest way to fix this is to use different layers.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Next

Return to How do I....?

Who is online

Users browsing this forum: blackhornet, evillair, gamecorpstudio, jorgmaquoi, ultrafop and 24 guests