Create new object on keypress

Get help using Construct 2

Post » Thu Jul 18, 2013 9:08 am

I have an event that destroys and object, this event has a sub event to create the same object when a key is pressed, but the object is not being created when I press the relevant key.

https://docs.google.com/file/d/0B4jakABNKNKZUXpTT1ZkcnhxMmM/edit?usp=sharing

Thanks for any help.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Thu Jul 18, 2013 9:14 am

Not sure why the link isn't an erm link!

Try again:

https://docs.google.com/file/d/0B4jakABNKNKZUXpTT1ZkcnhxMmM/edit?usp=sharing
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Thu Jul 18, 2013 9:14 am

It's normal, your subevent won't ever trigger, as it will check if the spacebar has just been stroke only 1 time, this time being just after (like 0.01 ms after) the ball has been destroyed.
What you may want is to take your subevent out of its uper-event, so it can trigger on its own. You may also want to add a condition "spr_ball.count = 0" if what you want is to spanw a new ball after the previous one has been destroyed, once the player hits the space bar.
B
17
S
8
G
4
Posts: 461
Reputation: 6,107

Post » Thu Jul 18, 2013 9:18 am

Many thanks Guizmus, I'll give that a go.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Thu Jul 18, 2013 9:30 am

That's fixed it, thanks again for the help.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Thu Jul 18, 2013 12:32 pm

Regarding posting links you need a certain rep-rating for them to work. So new or inactive members to the forum can't post links. Have the same issue. ^^
B
7
S
2
Posts: 38
Reputation: 555


Return to How do I....?

Who is online

Users browsing this forum: NN81, PreacH, S1mon, XMatrix and 11 guests