Random spawn of X-axis

Get help using Construct 2

Post » Wed Feb 19, 2014 12:37 am

Hi there's.!!! In my project I tried different way to spawn a actor so the actor can fall down, but how can I spawn an actor randomly only in X-axis to fall down ??? Thanks in advance
B
5
Posts: 26
Reputation: 548

Post » Wed Feb 19, 2014 1:33 am

On trigger event eg every X seconds:

System create object at int(random(Z,(LayoutWidth-Z)),Y)

Where Y is the Y "height" at which you want it to spawn.
Z is half the width in pixels of the object you want to create to ensure the spawned object always fits on screen.

There are 10 types of people in the World, those that understand binary and those who don't.
B
7
S
2
Posts: 93
Reputation: 797

Post » Thu Feb 20, 2014 2:59 pm

Sorry I miss the Y value for height, I will tried the code u gave me in the night, thanks a lot
B
5
Posts: 26
Reputation: 548


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests