0 Favourites

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

• 6 posts
• An object is going to spawn other objects randomly.How can i do that?

• Randomly in what way? In position? In time? In color? In orientation?

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

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

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