Click objects with mouse crosshair doesnt work

0 favourites
  • 6 posts
From the Asset Store
Create your game with this complete pack of images and animations!
  • Hi,

    I set My mouse pointer to be a crosshair graphics from a sprite.

    I have an event-action that says If mouse clicked on certain object, then destroy the object.

    Doesnt seem to work :(

    Same thing if I set the crosshair via 'set cursor style' -> crosshair ... it works.

    Anyone know why this odd behavior?

  • Could be broken somewhere, you could also have a condition where it says On Click and Sprite is over object, then do the action.

  • you could also have a condition where it says On Click and Sprite is over object, then do the action.

    Yeah I was gonna do the 'is crosshair sprite overlapping my object' and is clicked then destroy.

    Thanks :)

    But wanted to know why the 'is mouse clicked' not working if we choose to use mouse style from a sprite.

    Wondering to hear back from Ashley or someone :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • In most cases the sprite cursor attaches itself to the mouse so that the mouse is actually in the top-left corner of the sprite (hotspot) so try clicking the object assuming that is where the mouse is.

    If so, then change your sprites hotspot.

  • found the hotspot at right down corner.. put it in.. it "kinda" works now... but player has to shoot exactly the origin aimed :(

    I more like was expecting the whole size of sprite to be a pointer that can be aimed... so you dont have to be perfect aim to shoot.

    So I tried, is overlapping my object, and on-click destroy... that doesnt seem to change the behavior?

    I just want people to have it bit easy.. you click and anything under that crosshair gets destroyed.

    Cant seem to think of a way.

  • Could I see the capx?

    Other try: If CursorSprite is overlapping ObjectToDestroy and Mouse is clicked: Destroy!

    Should work if I understand correctly.

    Edit: More rather, if that doesn't work, then share the capx. Try it first though.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)