Click objects with mouse crosshair doesnt work

Get help using Construct 2

Post » Mon Mar 25, 2013 7:14 pm

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?
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,627

Post » Mon Mar 25, 2013 7:37 pm

Could be broken somewhere, you could also have a condition where it says On Click and Sprite is over object, then do the action.Equinox802013-03-25 19:37:51
B
26
S
5
G
5
Posts: 98
Reputation: 4,734

Post » Mon Mar 25, 2013 7:49 pm

> 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 :)
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,627

Post » Mon Mar 25, 2013 7:54 pm

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.
B
26
S
5
G
5
Posts: 98
Reputation: 4,734

Post » Mon Mar 25, 2013 8:27 pm

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.
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,627

Post » Mon Mar 25, 2013 8:39 pm

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.Equinox802013-03-25 20:40:05
B
26
S
5
G
5
Posts: 98
Reputation: 4,734


Return to How do I....?

Who is online

Users browsing this forum: Callan S, getplay, Kagubro, Yahoo [Bot] and 27 guests