Promble of double click

100062114100062114 Member Posts: 13

I want code a game whose actor will rotate after double click it.
When I double click one actor, it works correctly.
But a bug happaned. When I single click one actor and quickly click the other, the other actor will rotate.
How to modify the bug.

Comments

  • ArmellineArmelline Member, PRO Posts: 5,397

    Are the actors multiple copies of the same prototype?

  • 100062114100062114 Member Posts: 13

    Yes

  • ArmellineArmelline Member, PRO Posts: 5,397

    Make a self-attribute called "self.Taps" or something. You'll use it to distinguish each version of the actor from the others.

    When you update the "taps" count, update the self.Taps attribute rather than a game attribute. That way the taps will only be counted for that particular actor.

    If you're already using self attributes to count the taps, you'll need to provide a lot more detail :D

Sign In or Register to comment.