Orbiting an actor around another Actor in Windows.

I've been able to find the tutorials for orbiting an actor around another Actor in Gamesalad that TShirtbooth has put up, but every time I try and enter anything that requires the "[" and "]" brackets in the Windows version, it doesn't seem to work.

Am I just entering things in wrong, or is there a different way to Orbit an actor around another Actor in the Windows version of Game Salad?

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    Just constrain the orbiting actor's X and Y to sin and cos, like this:

    Constrain X position to: AAA*sin(game.Time *BBB)+CCC
    Constrain Y position to: AAA*cos(game.Time *BBB)+CCC

    AAA = the radius of your orbit.
    BBB = the speed of the orbit.
    CCC = the centre of your orbit.
  • HexxissHexxiss Member Posts: 12
    Awesome! Thank you so much.
  • SocksSocks London, UK.Member Posts: 12,822
    edited December 2012
    //
  • HexxissHexxiss Member Posts: 12
    now I'm running into another issue. While I got the object rotating around my actor, how would I go about making that object move along with my actor, while rotating? So I can move that actor, but it will still orbit it properly?
  • SocksSocks London, UK.Member Posts: 12,822
    edited December 2012
    now I'm running into another issue. While I got the object rotating around my actor, how would I go about making that object move along with my actor, while rotating? So I can move that actor, but it will still orbit it properly?

    Simply make your CCC values (the centre of the orbit) follow your actor.

    Constrain X position to: AAA*sin(game.Time *BBB)+[the X position of the 'parent' actor]
    Constrain Y position to: AAA*cos(game.Time *BBB)+[the Y position of the 'parent' actor]

    I've made an example for you:

    http://www.mediafire.com/?szrqgdrz3rxy3wi
  • HexxissHexxiss Member Posts: 12
    Wow! You have no idea how much that example helped, it was really easy to see exactly what was messing that up. Thank you so much for going above and beyond to help I really appreciate it!
Sign In or Register to comment.