How do I create object at a random point inside another?

Get help using Construct 2

Post » Tue Jan 31, 2017 10:15 pm

I want to create an object inside the spawnarea object, at a random point.

My thinking was:

X | random(spawnarea min, spawnarea max)
Y | random(spawnarea min, spawnarea max)

But no combination I have tried works.
B
15
S
8
G
2
Posts: 68
Reputation: 2,465

Post » Tue Jan 31, 2017 10:23 pm

Never mind, I figured it out, this is how I did it.

X random(SpawnArea.BBoxLeft,SpawnArea.BBoxRight)
Y random(SpawnArea.BBoxTop,SpawnArea.BBoxBottom)
B
15
S
8
G
2
Posts: 68
Reputation: 2,465


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 22 guests