Object Create Problem!

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • 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 <img src="smileys/smiley19.gif" border="0" align="middle" />

    How i solve this?.I wait your help.

    Best Regards,

  • 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...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Dude Thanks So much Trigger works Great <img src="smileys/smiley1.gif" border="0" align="middle" /> I solve the problem.You are great.Thanks So much. <img src="smileys/smiley1.gif" border="0" align="middle" />   <img src="smileys/smiley17.gif" border="0" align="middle" />   <img src="smileys/smiley32.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)