I'm having trouble with clones in my game



I'm making a game where you have to collect circles of a certain color, and I want to know how to make the circles different colors, and also how to make one clone disappear if my character bumps it. Any advice?


Sure! First use this code to make clones:

When game starts:
Set (Total number of clones) to (10) (change this number to whatever you like)

When (Current Number of Clones) < (Total number of clones)
Increase (current number of clones) by 1

When (Current Number of Clones) < (Total number of clones)
Create a clone

When object is cloned
Increase (index) by 1

When object is cloned
Set ((Self) index) to (index)

Now based on the index variable of each clone, you can control the colour

To make a clone disappear when it is bumped:

When Self bumps Object
Set Invisibility to 100

Different colours:
When object is cloned
Check if (Self)Index = 1
Set colour to red

Check if (Self)Index = 2
Set colour to yellow


Thanks! I'll try that!