Object Create Problem!

Get help using Construct 2

Post » Sat Nov 10, 2012 6:09 am

Hi,

I have a problem.I have got a variable that give random number every second between 1 and 4.I create a event like.

x variable equal to 1 --> System ,create A new object.
x variable equal to 1 --> System ,create B new object.and this continues

But the problem,System creates lot of object in a second

How i solve this?.I wait your help.

Best Regards,
B
10
S
3
G
3
Posts: 162
Reputation: 3,190

Post » Sat Nov 10, 2012 8:14 am

Sounds like this part of the manual will help:
System Condition - Trigger Once While True

"Turn an ordinary event (which is tested every tick) in to a trigger. For example, if an event plays a sound when lives equals 0, normally this event runs every tick. This plays about 60 sounds a second and would sound pretty bad. Adding Trigger once while true after the other conditions makes the event run just once when it first becomes true. This makes the previous example only play a sound once the first time your lives reaches 0. It must be the last condition in an event."


Alternately you could what you could do is have a 2nd event right after the event that creates the object (in the same condition that creates the object) that immediately resets the variable to a number that does not create any object

Variable - 1 through 4 create something, then set it to 5...gazoogle2012-11-10 08:17:50
B
34
S
4
G
8
Posts: 67
Reputation: 5,857

Post » Sat Nov 10, 2012 8:59 am

Dude Thanks So much Trigger works Great I solve the problem.You are great.Thanks So much.       
B
10
S
3
G
3
Posts: 162
Reputation: 3,190


Return to How do I....?

Who is online

Users browsing this forum: luckyrawatlucky, Yahoo [Bot] and 28 guests