How can I make 9 or more or fewer actors orbit around a single actor?

Dell7730Dell7730 Member, PRO Posts: 388

Just want to make a little demonstration of how 9 planets look like orbiting our sun, with different distance and speed. At least show me 2 actors around 1 actor, i'll take care of the rest, just need to be shown the direction.

Best Answers

  • SocksSocks London, UK.Posts: 12,822
    Accepted Answer

    Constrain position X to

    Distance * cos ((self.time * speed) + angle offset) + Sun's X

    Constrain position Y to

    Distance * sin ((self.time * speed) + angle offset) + Sun's Y

  • SocksSocks London, UK.Posts: 12,822
    edited March 2015 Accepted Answer

    @dellagarpo said:
    follow up question, they all start at the 0 angle position of the sun, how can i make it start at another angle? reason i asked is, what if there's two orbiting actors with the same distance? they will overlap each other, so how can I make one anchor at 0 degrees and one at another point?

    Could your question be summed up as 'how do I offset the angle' ?

    :wink:

  • SocksSocks London, UK.Posts: 12,822
    edited March 2015 Accepted Answer

    P.S. For moons travelling around planets, that travel around the Sun, you just need to add the moon's constrains (in relation to the planet) to the planet's constrain values (in relation to the Sun).

    Hope that makes sense.

  • SocksSocks London, UK.Posts: 12,822
    edited March 2015 Accepted Answer

    @dellagarpo said:
    it does, it really does, just find the anchor point of which to orbit around on

    Yes, exactly.

    So Earth would be . . . .

    Constrain position X to
    Distance * cos ((self.time * speed) + angle offset) + Sun's X

    Constrain position Y to
    Distance * sin ((self.time * speed) + angle offset) + Sun's Y

    . . .

    And the Earth's moon would be . . .

    Constrain position X to
    Distance * cos ((self.time * speed) + angle offset) + Earth's X

    Constrain position Y to
    Distance * sin ((self.time * speed) + angle offset) + Earth's Y

    EDIT - example attached.

  • LovejoyLovejoy Posts: 2,078
    Accepted Answer

    @dellagarpo said:
    the orbit rotates counterclockwise, is there a way to switch it around?

    use a negative number for speed

    ex. Distance * cos ((self.time * -speed) + angle offset) + Sun's X

    Fortuna Infortuna Forti Una

Answers

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    Constrain position X to

    Distance * cos ((self.time * speed) + angle offset) + Sun's X

    Constrain position Y to

    Distance * sin ((self.time * speed) + angle offset) + Sun's Y

    Thank you very much, as usual, you're one of my most valuable resource for knowledge

  • Dell7730Dell7730 Member, PRO Posts: 388
    edited March 2015

    follow up question, they all start at the 0 angle position of the sun, how can i make it start at another angle? reason i asked is, what if there's two orbiting actors with the same distance? they will overlap each other, so how can I make one anchor at 0 degrees and one at another point?

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    :wink:

    Gotcha, thanks again

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    P.S. For moons travelling around planets, that travel around the Sun, you just need to add the moon's constrains (in relation to the planet) to the planet's constrain values (in relation to the Sun).

    Hope that makes sense.

    it does, it really does, just find the anchor point of which to orbit around on

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks just curious, got any games I can check out and play?

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    ...

  • Dell7730Dell7730 Member, PRO Posts: 388

    the orbit rotates counterclockwise, is there a way to switch it around?

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Lovejoy said:
    ex. Distance * cos ((self.time * -speed) + angle offset) + Sun's X

    Thank You Sir/Ma'am, I do appreciate it

Sign In or Register to comment.