0 Favourites

How do I make a trail effect

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

  • Construct 3

    Buy Construct 3

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

    Buy 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!

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