Question about orbiting objects!!
bartvicic
Member, PRO Posts: 14
hi, i'm making this app where i want certain objects to be spawned orbiting. all around the same object. i already have the code to make them orbit, however you have to type in the distance between the two objects (the orbiting one from the static one). i want that distance to be random and different with every orbiting object spawned. i want each to orbit at a different orbiting distance and the distance to be random.
can anyone help please ) im looking forward to your response!
can anyone help please ) im looking forward to your response!
Comments
and how many orbiting actors do u want?
before each spawn you can change attribute distance to random(1,300)
you could spawn each actor with a slight rotation(direction)
make a new variable
set variable to 0
spawn new orbiting actors with direction = variable
set variable to variable +1 (so it allways changes the rotation of your actors a bit)
next thing you would need is to make a table with 1 column
where you would input your random distances
input distances like
change table value
you table
row=direction+1
Column=1, Value=random(1,300)
row is changing according to direction, column is always 1 cause you have 1 column
In you orbiting code
replace distance with tablecellvalue your table, rotation of actor+1, 1
I Hope this helps
I've made you a quick demo project, click the circle to make orbiting 'moons'.
Link: https://www.mediafire.com/?j93zerqyx7ccjaf
Same deal, but interpolating the moon's orbit (radius):
Link: https://www.mediafire.com/?p3plevhlle2rf9l