# How do I spawn an object randomly to another objects?

Get help using Construct 2

### » Tue Dec 15, 2015 8:26 pm

An object is going to spawn other objects randomly.How can i do that?
B
30
S
15
G
1
Posts: 135
Reputation: 3,356

### » Tue Dec 15, 2015 9:41 pm

Randomly in what way? In position? In time? In color? In orientation?
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,867

### » Wed Dec 16, 2015 11:25 am

gumshoe2029 wrote:Randomly in what way? In position? In time? In color? In orientation?

i mean i have 5 floor pieces and a bomb object.I want to set bomb's position every x seconds same with random floor pieces.

B
30
S
15
G
1
Posts: 135
Reputation: 3,356

### » Wed Dec 16, 2015 8:31 pm

Sorry, I did not understand. You want to randomly move the bomb every X seconds, or spawn random floor parts ?

If it's moving the bomb to a random position, it's something like that :
Every X seconds => Set bomb position to X(random(x1, x2) and Y(random(y1, y2) with x1, 2 and y1, 2, being the intervals.

If you provide a small capx, we should show you more precisely.
B
15
S
4
Posts: 122
Reputation: 1,332

### » Wed Dec 16, 2015 9:41 pm

Nabu0001 wrote:Sorry, I did not understand. You want to randomly move the bomb every X seconds, or spawn random floor parts ?

If it's moving the bomb to a random position, it's something like that :
Every X seconds => Set bomb position to X(random(x1, x2) and Y(random(y1, y2) with x1, 2 and y1, 2, being the intervals.

If you provide a small capx, we should show you more precisely.

I want to move the bomb every x seconds to floor parts but not according to a particular sequence.When the bomb moved to random floor part,the floor part will be destroyed.After this,the bomb will move to any other random floor and destroy it.That's what i want.I hope i can told this time.
B
30
S
15
G
1
Posts: 135
Reputation: 3,356

### » Sat Dec 19, 2015 9:37 pm

Sorry for the delay. Ok, you want your bomb to suddenly appear on top of a random floor tile ? Or you want it to move until it reaches the tile ?
Can you post a link to you capx project ?
B
15
S
4
Posts: 122
Reputation: 1,332