mouse click registers outside of actor

fritzdcfritzdc Member Posts: 6
edited December 2011 in Working with GS (Mac)
Greetings,
I have an interesting problem where my mouse clicks are registered everywhere in the scene NOT just on the actor.

I have created a very simple game that contains one actor that is placed in the middle of the scene. The actor has one rule "when actor receives event" "mouse button" "down" and one behavior "rotate".

If I click anywhere in the scene my actor rotates. I would expect my actor to rotate only if I click on the actor but this is not the case.

Any help is appreciated.
Thanks, fdc

Comments

  • ozboybrianozboybrian PRO Posts: 2,102
    edited December 2011
    I gave it a go and it does the same thing for me.

    Try Touch instead of mouse button. It works that way.

    Edit - I beat Ace to it, now it's gonna goto my head :P
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    edited December 2011
    That is not a bug, it is supposed to work like that. You are saying that when the mouse button is down, do something, so when the mouse button is down, it's doing it. You can use touch is pressed rule and will work with the mouse fine, not just for device touches.

    Ace
  • fritzdcfritzdc Member Posts: 6
    touch works perfectly :-) thanks
  • POMPOM Member Posts: 2,599
    edited December 2011
    @fritzdc
    Its exactly how it should be ;)
    Think about it , you tell your actor to do something when the mouse button is down , then when you preview your game , and press the mouse button (it is down now), It does what you told him to do :D
    If you want your actor to trigger only when you press inside him you can use 1 out of 2 methods :

    1) when touch is pressed (recommended)

    2)when mouse button is down AND when mouse is inside .


    EDIT :
    AArrrrr ACE beat me !

    Cheers
    Roy.
Sign In or Register to comment.