How to get an actor to orbit around another actor while one actor is moving?

So i have one red actor that rotates and when i click the mouse the white actor begins to orbit the red actor. I am trying to get the red actor to go from the top of the screen to the bottom and when i click on the mouse it orbits around the red actor. But instead of orbiting the actual location of the red actor it orbits the original location of the red actor. How can i get the white actor to follow and orbit the red actor when i click? Thank You in advance =}

Comments

  • DenimSharkDenimShark Member Posts: 192
    unlock the white actor and constrain its x.position to trig.stuff + red.actor.x and do the same for its y.position
  • SocksSocks London, UK.Member Posts: 12,822
    Constrain X position to: AAA*sin(game.Time *BBB)+[the X position of the 'Red' actor]
    Constrain Y position to: AAA*cos(game.Time *BBB)+[the Y position of the 'Red' actor]

    AAA = the radius of your orbit.
    BBB = the speed of the orbit.

    http://www.mediafire.com/?szrqgdrz3rxy3wi
Sign In or Register to comment.