Actor angle as it relates to another actor's angle
I have two rotating actors in a scene. When one is pressed, it freezes into position. Same for the other one. If they are both frozen in the same exact position (rotation angle, etc) I'd like to trigger a new scene or animation. How can I set up a Rule so that something happens if they both are frozen in the same position???
Ideally, it would be something like:
If self.angular velocity = otherActor.angular velocity; Change Image, Change Attribute
any tips?
thanks in advance
Ideally, it would be something like:
If self.angular velocity = otherActor.angular velocity; Change Image, Change Attribute
any tips?
thanks in advance
Comments
When you press actor 1:
change attribute self.angular velocity to 0
change attribute game.rotation1 to self.rotation
When you press actor 2:
change attribute self.angular velocity to 0
change attribute game.rotation2 to self.rotation
Then elsewhere have a rule that says when game.rotation1= game.rotation2, perform action.
However note that rotation is not just measured in 1 degree increments, you can have decimals too, (180.4 degrees etc), so it would be pretty tricky for the user to stop both with exactly the same rotation as each other.
So you may want to give them some room for error, for example instead of saying:
if game.rotation1 = game.rotation2, (requiring exactly the same rotation)
you could say:
if game.rotation1 (is smaller than) game.rotation2+1 and game.rotation1 (is bigger than) game.rotation2-1
Perform action, as this will give you a margin for error.
Hope that makes sense.