How can I make 9 or more or fewer actors orbit around a single actor?
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
-
Socks London, UK.Posts: 12,822
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
-
Socks London, UK.Posts: 12,822
@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' ?
-
Socks London, UK.Posts: 12,822
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.
-
Socks London, UK.Posts: 12,822
@dellagarpo said:
it does, it really does, just find the anchor point of which to orbit around onYes, exactly.
So Earth would be . . . .
Constrain position X to
Distance * cos ((self.time * speed) + angle offset) + Sun's XConstrain 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 XConstrain position Y to
Distance * sin ((self.time * speed) + angle offset) + Earth's YEDIT - example attached.
-
Lovejoy Posts: 2,078
@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
Thank you very much, as usual, you're one of my most valuable resource for knowledge
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?
Gotcha, thanks again
it does, it really does, just find the anchor point of which to orbit around on
@Socks just curious, got any games I can check out and play?
...
the orbit rotates counterclockwise, is there a way to switch it around?
Thank You Sir/Ma'am, I do appreciate it