[SOLVED]How do I set a Pinned Particle System angle?

Get help using Construct 2

Post » Fri Sep 02, 2016 12:24 am

I have a particle system pinned to my ship. It is visually acting as a thruster. When they accelerate the particle system turns on, if they let go the particle system turns off. The issue being I cannot get the angle right on the particle system. It is shooting particles into the ship instead of out the back. This sorts itself once they pick up speed, but at the beginning when they are just starting it's shooting into the ship.

Image
Last edited by VictoryX on Fri Sep 02, 2016 5:28 am, edited 1 time in total.
Image
B
47
S
17
G
3
Posts: 206
Reputation: 5,061

Post » Fri Sep 02, 2016 1:06 am

Did you try setting the particles angle to the Player.X/Y ?
B
56
S
15
G
13
Posts: 826
Reputation: 17,705

Post » Fri Sep 02, 2016 1:18 am

I found a work around of settling the particle systems angle to the player.angle*-0.5 . It stills looks like it isn't coming exactly out of the center back of the ship, but it's close enough for now.

EDIT: Upon further testing I still have no fix for this. I tried setting it's angle by the Player.X and Player.Y no go.
Image
B
47
S
17
G
3
Posts: 206
Reputation: 5,061

Post » Fri Sep 02, 2016 1:36 am

https://dl.dropboxusercontent.com/u/729 ... Arena.capx heres the .capx if anyone has any ideas.
Image
B
47
S
17
G
3
Posts: 206
Reputation: 5,061

Post » Fri Sep 02, 2016 3:03 am

I found when Player's angle was set to 0 on Line 67, the thrust worked the way it should.

However, changing Player's angle to 0 also changed enemy characters' angles to 0, and now they're all moving to the same direction. :shock:

I believe a possible solution would be only allowing player to spawn while facing right, and forcing enemy characters' to spawn while facing random angles.
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Fri Sep 02, 2016 3:20 am

I tried your solution, setting the player angle to 0 on creation and it still doesn't work for me.

All the ships in the game are players, if you had 4 controllers hooked up you could control each one independently.

All the ships are the same sprite as well which just a hue shift to make them appear different.

They are controlled by an assigned ID on creation.

That is why if you change the angle on creation all of their angles are changed.
Image
B
47
S
17
G
3
Posts: 206
Reputation: 5,061

Post » Fri Sep 02, 2016 3:55 am

Image

If they're all player controlled objects, I think setting the player angle to 0 will resolve the issue.

I tested and confirmed (only) when I set the player angle to 0, the ships would show the correct thrusts.
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Fri Sep 02, 2016 4:13 am

Could you link me the fixed .capx so I can take a look at it? Maybe with a comment where u changed the code because changing it on my end doesn't seem to fix the issue for me.
Image
B
47
S
17
G
3
Posts: 206
Reputation: 5,061

Post » Fri Sep 02, 2016 4:56 am

Here's the modified file with comments. :mrgreen:

https://www.dropbox.com/s/9f4a3fd71ydnv ... .capx?dl=0
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Fri Sep 02, 2016 5:26 am

Your .capx still presented the issue for me. But I found a solution, the issue was I wasn't asking my question right. This whole time I should have been asking how to get the opposite angle for a specified angle. IE 360's opposite would be 180 degrees. This way I could feed that number into the Particle Systems angle and be set.

solved-opposite-angle-in-degrees_t63118

This awesome post answered my question with an equation.

Particle System Set Angle to (180+Player.Angle)%360

Using the Modulus Operater (%) is what does the trick.

Thank you very much for your help I really appreciate the effort you put in to finding an answer for me.
Image
B
47
S
17
G
3
Posts: 206
Reputation: 5,061

Next

Return to How do I....?

Who is online

Users browsing this forum: dop2000, Scofano and 12 guests