Store Gameobject into Varianle Selected from Family

Get help using Construct 2

Post » Wed Nov 18, 2015 11:25 am

Hello all,

I am working on Flappy Bird Clone Game. I am using different kinds of pipes instantiating at run time randomly selected from family. I am facing one problem that as Y position of my Lower pipe depends upon the Y position of upper pipe as Upper pipe Y position is also selected randomly at run time. is there any way that i can get the GameObject reference selected at run time so that i can give the position of Lower pipe according to that randomly selected gameobject's Y position.

Posts: 12
Reputation: 229

Post » Wed Nov 18, 2015 11:36 am

Shouldn't be hard to get the y-position of the last created pipe..
Would be easier to explain if we knew your events to create them..
If both pipes are created in the same event, storing the y-position of the first in a local variable and using that to determine the position of the second should work..

That would use a system set variable to family.y after creating, or set the variable to a random number and creating both pipes based on it..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
Posts: 6,160
Reputation: 19,775

Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 3 guests