Orbit problem- How to start orbiting anywhere?

Mr HansonMr Hanson Member Posts: 94
edited September 2012 in Working with GS (Mac)
Hello everyone

I ran into a little problem which i can't seem to fix. How would i make it so an actor (earth) can rotate around the larger actor (sun) at any point?

I have been using the Orbit demo and it has the equation:

Constrain Attribute self.position.x to 100*cos(self.time*-200%360)+game.sunX

Constrain Attribute self.position.y to 100*sin(self.time*-200%360)+game.sunY

Constrain Attribute self.rotation to vectorToAngle( game.sunX - self.Position.X , game.sunY - self.Position.Y )

This makes it start on the right hand side of the sun no matter where it is replaced. I would like it to start orbiting from where it gets placed.

If anyone can help that would be great!

Thanks
JonApp

Answers

  • Mr HansonMr Hanson Member Posts: 94
    Hello

    Can any one help? Just Pm me so i can give you a detailed description and an image of what i need help with!

    Thanks

    JonApp
  • Yovanny369Yovanny369 Member Posts: 105
    I have something for you
    not sure if it's what you want :D
  • Mr HansonMr Hanson Member Posts: 94
    Thanks @eduard0369 for replying. I currently decided to upgrade gamesalad which means I also had to up grade to Mountain lion. So this may take some time so I am unable to have a look at what you recommended till for a while.

    All the best
    JonApp
  • Yovanny369Yovanny369 Member Posts: 105
    No problem.

    Cheers!
Sign In or Register to comment.