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

0 favourites
  • 11 posts
From the Asset Store
19 glow particle sprites in 4 colors and different shapes.
  • 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.

  • Did you try setting the particles angle to the Player.X/Y ?

  • 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.

  • https://dl.dropboxusercontent.com/u/729 ... Arena.capx heres the .capx if anyone has any ideas.

  • 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.

    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.

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Here's the modified file with comments. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    https://www.dropbox.com/s/9f4a3fd71ydnv ... .capx?dl=0

  • 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.

    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.

  • You're most welcome, VictoryX. I'm glad I was able to provide some assistance. 'Set Angle to (180+Player.Angle)%360'? Wow, I haven't thought of that.. I learned as well. Thank you very much, VictoryX.

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