particles

Get help using Construct 2

Post » Sun Dec 13, 2015 7:24 pm

is it possible to pin particles to sprites
B
10
S
4
Posts: 144
Reputation: 1,246

Post » Sun Dec 13, 2015 7:43 pm

Yes.
B
88
S
30
G
90
Posts: 5,114
Reputation: 60,839

Post » Sun Dec 13, 2015 8:01 pm

R0J0hound wrote:Yes.


hi I'm new to construct and making my first game/project, I'm trying to pin a particle to a player sprite. I'm looking to trigger the particle effect ive got, when colliding with enemy ai.
B
10
S
4
Posts: 144
Reputation: 1,246

Post » Sun Dec 13, 2015 8:03 pm

On collision with enemy > set Particle position to Player.X, Player.Y.
B
43
S
13
G
59
Posts: 1,779
Reputation: 35,731

Post » Sun Dec 13, 2015 8:18 pm

plinkie wrote:On collision with enemy > set Particle position to Player.X, Player.Y.


thanks it sort of works. when the player is hit its starts the particle effect but is not pinned. when I pin it with on collisions it doesn't appear and its stopping my health value from decreasing. **** games get complicated fast lol
B
10
S
4
Posts: 144
Reputation: 1,246

Post » Sun Dec 13, 2015 8:24 pm

If you add the "pin" behavior to the particles and position the particles object on top of the sprite in the editor, you can then add a "start of layout" event to your event sheet and add a action to pin the particles to the sprite. Then from that point on the particles will go wherever the sprite goes.

https://www.scirra.com/manual/99/pin
B
88
S
30
G
90
Posts: 5,114
Reputation: 60,839

Post » Sun Dec 13, 2015 8:26 pm

@jamiek

I don't know how exactly you've set up the damage and how long you want to be hit for and for the particle to be displayed etc but you can use :

Every tick > set particle position to Player.X, Player.Y.

This would set it to player position constantly (give the effect of pinning) until destroyed.

A possible destroy event might be after the particle hit effects have shown for a few seconds then you can say:

On particle created > wait 3 seconds > destroy.

It will obviously require some tweaking if you want to stop particle effects during certain scenarios. It all depends on what exactly what you want but it will all be possible in C2 :)
Last edited by plinkie on Sun Dec 13, 2015 8:28 pm, edited 1 time in total.
B
43
S
13
G
59
Posts: 1,779
Reputation: 35,731

Post » Sun Dec 13, 2015 8:27 pm

@R0J0hound

are you sure that works? I've seen this issue come up before where particles don't actually pin. I remember having to simulate it with position. Not a huge problem though I guess.
B
43
S
13
G
59
Posts: 1,779
Reputation: 35,731

Post » Sun Dec 13, 2015 8:46 pm

@ @R0J0hound

ok sorry I'm going to have to talk to two of you in the one post, I had the sprite pinned but was stopping the health bar and going constantly. then I had it pinned the way the tutorial says but like plinkie it wont work its just pinned to where ever the default player starts.
I'm sorry I can share more with you but my event page barley makes sense as it is with the rest whenever that comes. got few bugs to work out.
B
10
S
4
Posts: 144
Reputation: 1,246

Post » Sun Dec 13, 2015 9:07 pm

plinkie wrote:@R0J0hound

are you sure that works? I've seen this issue come up before where particles don't actually pin. I remember having to simulate it with position. Not a huge problem though I guess.


yeah they only pin to where the player is at that exact time it wont pin as far as I can see
B
10
S
4
Posts: 144
Reputation: 1,246

Next

Return to How do I....?

Who is online

Users browsing this forum: Soulmachine and 13 guests