How do I make particles fade in/offset origin?

0 favourites
  • 6 posts
From the Asset Store
Particles support animations, collisions, effects and etc.
  • So as far as I can tell there are actually no features like this, but figured I'd ask anyway. Is there a way to:

    a) Make particles fade in from start? Normally particles fade out of existence, but I'm trying to achieve a reverse effect where individual particles fade in from invisible when they're spawned. Particles have an option to set initial opacity and an opacity randomizer, but no gradual opacity change (other than fading out as part of their destroy conditions).

    b) Offset particles from origin relative to their angle of travel? Particles have an offset option, but this is determined separately from their angle. I was looking to create an effect where particles will fan out in a cone, but instead of all originating at one spot, have a slight offset to their spawn point. Unfortunately, with the current setup particles that are offset are also given a random angle after they spawn, meaning that a particle can travel in a different direction than its angle relative to the origin of the object. In a way, this effect could actually be faked by the feature described in point (a).

    Thus far I've faked both of these effects by placing a gradient (basically a sprite of a brush stroke with hardness set to 0) on top of the particle object, so particles look like they fade in as they move out from behind the object. However, this only works because the gradient blends in with the background, but the background is likely to be dynamic and change, thus revealing the object. I've attempted to play around with blend modes, but so far no luck as these tend to conflict with the blend modes of the particles.

  • If your project isn't going to be hugely CPU intensive from other aspects of the game, or isn't looking for release on mobile devices, you could replace the particle object with a 'sprite' object which would allow you to enact both situation a) and b) above. I'm not sure how much more CPU intensive using individual instances of a sprite rather than a single particle sprite would be, however it may be a necessary / valuable consideration because you'll be able to do a whole lot more with the objects than particles.

    I hope this helps a little.

    Regards,

    Gideon

  • If you set the "Initial particle property" Opacity to -100, change the "Particle lifetime properties" Opacity randomiser to a positive number and Destroy mode to "Timeout Expired" you actually manage to get a fade in from the particles object.

    If you use the X and Y randomiser "Initial particle property" those directly depend on the Particle object angle.

    So I'm not sure what your issue actually really is with the second part of your question.

    Example capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • GideonG Sprites would work I suppose, but this is supposed to be for a background doodad that just looks pretty so I'm hesitant to make it any more CPU intensive than it needs to be.'

    Kyatric Thanks for the tip, I think this will work for the effect I'm trying to make!

    By the angle thing I mean the angle of travel of the particle in relation to the origin point rather than the angle of the entire particle object. Basically I wanted the particles to always travel away from the origin when spawned with an offset. E.g. let's say there's a 180 degree spray cone pointed upwards. A particle spawns with a random offset of -10 on the X axis, so it's directly to the left of the origin. However, it's angle of motion takes it due right, so it travels back over the origin point. What I ideally wanted was for it to move away from the origin in the same direction as its offset, due left. This would basically form a circle around the origin where particles spawn along its circumference and travel directly away from the origin.

    Anyway, thanks for the help guys.

  • If you set the "Initial particle property" Opacity to -100, change the "Particle lifetime properties" Opacity randomiser to a positive number and Destroy mode to "Timeout Expired" you actually manage to get a fade in from the particles object.

    I didn't even know this was possible! You have just posed a solution to so many 'little things' I've been struggling with over various projects, thanks a heap!

    And sup with that?, I did some testing last night and I don't actually think that sprites used to do particle effects are much more intensive than the particle plugin. That being said, Kyatric's solution is far more elegant and efficient, so disregard what I was saying.

    Hope you can solve your issue!

    Gideon

  • Sup with that: Aren't you then simply needing to set the arc to 360° ?

    This way, any particle will directly move right away from the origin point, whatever their offset.

    I'm afraid I don't know how to help further on this otherwise.

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