enable ONLY while mouse is over

Get help using Construct 2

Post » Sat Feb 22, 2014 9:11 pm

Here's the setup I'm going for:
When the mouse hovers over a sprite, the sprite spawns particles. When the mouse is NOT over the sprite, it DOES NOT spawn particles.
I can get the particles to work, & I can get them to appear when the mouse is over the sprite by using this event:
Mouse|Cursor is over Sprite|Sprite|Spawn Particles on Layer0 (Image point1)
But when I move the mouse away, the sprite is still spitting out particles. How do I turn it off?
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Sat Feb 22, 2014 9:15 pm

Just after the event where you start to spawn particules, put an "Else" => Particles->Destroy
B
17
S
8
G
4
Posts: 461
Reputation: 6,127

Post » Sat Feb 22, 2014 9:18 pm

that's what I needed
thanks
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Sat Feb 22, 2014 9:24 pm

Well, not sure if it was you, but there was a similar topic a second ago and I made an example. Here is my answer, as the topic has been deleted, and you have the same problem (if anyone searches for it someday)

Here is an example.

You do the following :
- Add an event "Sprite : On created", and disable the effects there.
- Add a simple "Mouse over object : Sprite" event, enabling the effect, and an else, disabling it.
B
17
S
8
G
4
Posts: 461
Reputation: 6,127


Return to How do I....?

Who is online

Users browsing this forum: jaytrott86, Yahoo [Bot] and 6 guests