How do I make a trail effect

0 favourites
  • 7 posts
From the Asset Store
A total of 214 high quality and unique magic sound effects suitable for RPG, Battle Arena and more!
  • Hello, so i was wondering if i could make a simple trail effect, for example:

    Example 1

    Example 2

    I'd appreciate helping me.

  • Here's one way of doing it, with every step commented.

    [attachment=0:c6gco203][/attachment:c6gco203]

    This is the simplest way to get an unbroken trail. Unbroken, of course, meaning that if a fast moving object has a trail, there will be no breaks due to speed, as trail segments are created depending on how far the object has moved since the last frame.

    You'll want to be careful with performance on this, most especially if you're targeting mobile. It would be better to limit this to objects that aren't moving excessively fast, or to have a quick fade-out time on trail segments to keep the amount of segments created to a minimum.

    Let me know if you have any questions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • linkman2004 Wow!, you're amazing, sir! That's exactly what i needed! i really don't know how to thank you, please let me know if i can help you with anything :)

    i'm so happy right now :D

    EDIT: i can't seem to make TrailGlow to follow the Character when i'm moving with the 8Direction behavior not with the mouse.

  • i can't seem to make TrailGlow to follow the Character when i'm moving with the 8Direction behavior not with the mouse.

    That's because most behaviors -- 8 Direction included -- update before events are processed. Set OldX and OldY after all of the trail events -- at the end of the event sheet, for example -- and things will work. As it stands now, the flow of actions is:

    Update 8-Direction behavior -> Set OldX, OldY -> Update trail, Result: OldX and OldY equal the actual position when the trail is updated, thus, no trail.

    Whereas updating afterwards yields:

    Update 8-DIrection behavior -> Update trail -> Set OldX, OldY, Result: OldX and OldY are different from the actual position when the trail is updated since they were updated at the end of the previous frame.

  • linkman2004 Ah!, thanks.. that did it :D

    EDIT: I really love playing with the effects on this xD

    [attachment=0:2mkso8vw][/attachment:2mkso8vw]

    [attachment=1:2mkso8vw][/attachment:2mkso8vw]

    You can do alot more amazing things with this!

  • Reupload because I think the new forums removed attachments. Great example linkman2004!

    dropbox.com/s/o54wwt7wg1pfuh5/trail%20%281%29.capx

    i.imgur.com/YQgAdve.png

  • If the object is not moving too fast, you can make the same trail effect with just 1 particles and no events.

    dropbox.com/s/v92bzkve0x6fdx6/ParticlesTrail2.capx

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