GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Rotation Problems

VisualBasicCVisualBasicC Posts: 3Member
edited October 2013 in Working with GS (PC)
I'm having a little difficulty having my actor rotate and face the position where the mouse was/is down.

Right now I have:

When mouse is down and not over actor:
Every 0.1 seconds:
Rotate to Mouse position x, y.

Unfortunately it rotates in the opposite direction of where the mouse was clicked. Ive tried setting the co-ordinates relative to scene or actor but none of those solved the problem.

Any solutions?

Comments

  • BBEnkBBEnk Posts: 1,764Member
    make a rule when mouse is pressed then add a constraint attribute self.rotation to vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )
  • Cool! That's just what I was looking for, but is there anyway to keep it from loosing the mouse position when the mouse goes out of the scene boundaries? In my test the rotation stops when the mouse leaves the edge of the scene.
Sign In or Register to comment.