Rotate & Move
aalzanki
Member Posts: 283
Hello,
Guys I used this example to rotate an actor with spinning it :
Create two integer game attributes spinX and spinY
Create an invisible actor with rule:
when touch is pressed
constrain self.positionY to touchY
constrain self.positionX to touchX
constrain game.spinY to self.positionY
constrain game.spinX to self.positionX
In the spinning objecting:
When touch is pressed and inside
constrain self.rotation to VectorToAngle(self.positionX-game.spinX, self.position.Y-game.spinY)
So i want when the actor rotates at a high speed the other actor move at a high speed and when it rotates at a low speed the other actor move at a low speed, how?
Regards,
Guys I used this example to rotate an actor with spinning it :
Create two integer game attributes spinX and spinY
Create an invisible actor with rule:
when touch is pressed
constrain self.positionY to touchY
constrain self.positionX to touchX
constrain game.spinY to self.positionY
constrain game.spinX to self.positionX
In the spinning objecting:
When touch is pressed and inside
constrain self.rotation to VectorToAngle(self.positionX-game.spinX, self.position.Y-game.spinY)
So i want when the actor rotates at a high speed the other actor move at a high speed and when it rotates at a low speed the other actor move at a low speed, how?
Regards,
Comments
rule - when touch is preesed and inside
rotate to position:
touchX touchY offset- depanding on your actor's angle
relative to scene
and uncheck "run to completion" and "stops on destination"