Help on Repeat

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi guys!

    Having a bit of trouble with the repeat and for each tool.

    Basically, I want to be able to create an object a certain number of times. The system will count how many times an object appears, and then create that many additional objects which then are placed atop.

    The problem is, the loop never seems to stop. I even tried "Repeat 10 times - create object", and it just goes on and on.

    Repeat Test

    My For Each is getting similar results.

    Now I've looked at other posts, and found the one on health bars quite interesting, but I don't think it applies to what I'm ultimately trying to create. Eventually I'd like to use the same tool for creating multiple pivot points, but I think it's way above my help at the moment.

    If someone could correct the Repeat program I made, I'd be very grateful. If there's any bright sparks that know how to create a pivot point with physics for each object, then I would be very happy.

    The idea I have is that if the system finds a pivot sprite, it will create a rotating physics bar to it. I tried to do this manually, but all the bars were linked to the same pivot point. Looked odd :)

    Any help would be greatly appreciated!

  • That 'repeat 10 times' repeats 10 times every tick. You need to make it a subevent of 'on start of layout' or something similar.

  • Ahh, does the same apply for the 'for each'?

  • Yeah if it's a top level event it will run every tick.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, ill give it a go. Do you know how to solve the physics joint issue?

  • Here's an example: repeat.capx

  • Brilliant! Thank you very much! A lot more straight forward than I thought!

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