Rotate Around Centre In Relation To Mouse

robert.mccarthyrobert.mccarthy Member Posts: 165
edited November -1 in Working with GS (Mac)
Hi All,

Need some help with getting an actor to rotate about it axis depending on mouse position.

Can anyone help point me in the right direction?

Thanks,

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    sure .. open GS and in the NEW+ area search rotate. The third one that comes up is rotate around mouse. Double click it and it will open on your computer for you to sav/edit and see how its done
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    http://gamesalad.com/wiki/how_tos:gsc_circular_movement

    But instead of the +240 and the +160, use the mouse position.
  • PhoticsPhotics Member Posts: 4,172
    robert.mccarthy said:
    Need some help with getting an actor to rotate about it axis depending on mouse position.

    Can anyone help point me in the right direction?

    I think the information you're looking for is in The Unofficial GameSalad Textbook. Basically, the Rotate to Position behavior or Magnitude is what you're looking for.

    Put game.Mouse.Position.X in the first field
    ...and game.Mouse.Position.Y in the next field

    The circle will rotate in relation to the mouse position.
  • robert.mccarthyrobert.mccarthy Member Posts: 165
    Hi All,

    Thanks but I think I have explained a little wrong (or with two meanings).

    Basically, I have a long arrow. I want it to spawn when I have my mouse down. Then when the mouse is down, I want it to rotate in relation to me moving my mouse. So if I move my mouse a bit left, then it will follow the mouse and rotate in one direction only a bit (and vice versa for the other way).

    Cheers,
  • robert.mccarthyrobert.mccarthy Member Posts: 165
    Sorted it, cheers though!
  • robert.mccarthyrobert.mccarthy Member Posts: 165
    Actually, I have come back to it and this didn't sort it.

    I'm after an arrow that moves around its axis depending on the mouse position.

    So if the mouse is in position north then the arrow will be facing north.

    As the user moves to another position on the screen, it follows on its axis.
Sign In or Register to comment.