Question about orbiting objects!!

bartvicicbartvicic 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!

Comments

  • nizzar27nizzar27 Member Posts: 8
    how do u make the new actor orbit the static one?

    and how many orbiting actors do u want?
  • bartvicicbartvicic Member, PRO Posts: 14
    I want like a lot of them they get spawned and destroyed again and again. I make them orbit by tmaking a new rule - just follow the instructions on youtube, there is a long code to type into the field.
  • nizzar27nizzar27 Member Posts: 8
    i think u have a variable distance which u use so
    before each spawn you can change attribute distance to random(1,300)
  • bartvicicbartvicic Member, PRO Posts: 14
    But that distance effects all of them how do i make each one's different from the prototype?
  • nizzar27nizzar27 Member Posts: 8
    edited February 2014
    if you wouldnt mind some rotation to your actors
    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
  • bartvicicbartvicic Member, PRO Posts: 14
    Wow this sounds very complicated, what did you mean by that variable exactly? Can you please explain the process step by step ive actually never really worked with columns before.. Thank you so much for helpin me out;)
  • bartvicicbartvicic Member, PRO Posts: 14
    But i get the picture.. Make something with each actor spawned to make it unique? - allowing me to do what i want to
  • SocksSocks London, UK.Member Posts: 12,822
    @bartvicic

    I've made you a quick demo project, click the circle to make orbiting 'moons'.

    Link: https://www.mediafire.com/?j93zerqyx7ccjaf
  • SocksSocks London, UK.Member Posts: 12,822
    @bartvicic

    Same deal, but interpolating the moon's orbit (radius):


    Link: https://www.mediafire.com/?p3plevhlle2rf9l
  • bartvicicbartvicic Member, PRO Posts: 14
    hey thanks a bunch, what an effort for someone u dont even know.. respect!
Sign In or Register to comment.