Constrain, ahhhhh
joey2e
Member Posts: 99
Hey all
Right am stuck, although I suspect I am just being a little slow!!!
I have an actor we will call X for the time being.
I want X to rotate according to where I touch the screen, however I don't want him to rotate past a certain point, i,e I want the actor to only rotate between 0 degrees and 60 degrees, also asides from rotating I dont want the actor to move at all.
I have tried lots of different variations and just cant seem to get it to work.
Any suggestions would be well appreciated
Right am stuck, although I suspect I am just being a little slow!!!
I have an actor we will call X for the time being.
I want X to rotate according to where I touch the screen, however I don't want him to rotate past a certain point, i,e I want the actor to only rotate between 0 degrees and 60 degrees, also asides from rotating I dont want the actor to move at all.
I have tried lots of different variations and just cant seem to get it to work.
Any suggestions would be well appreciated
Comments
constrain self.AngleToTouch to VectorToAngle(gam.Touch1X-self.positionX,game.Touch1Y-self.positionY)
Constrain self.rotation to max(0 ,min(60 , self.AngleToTouch ))