How can i constrain the rotation of a switch?
TheFloatingSofa
Member Posts: 21
i have the rotation constrained to touch x so when i slide my finger it rotates. i just want it limited to rotate between 0 and 180.
Answers
constrain self rotation to max(0,min(180,vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )))
http://www.mediafire.com/?2pcp78o59qzw1r5
The half rotation works fine, but this is only affected when touch is below the actor. How can I achieve so actor's rotation always follow my finger, but has got it's min and max, let's say 30 and 150'?
I would much appreciate any help here as I find myself stuck.