How do I make a trail effect

Get help using Construct 2

Post » Sat Oct 11, 2014 12:27 pm

Hello, so i was wondering if i could make a simple trail effect, for example:

Example 1
Example 2


I'd appreciate helping me.
B
22
S
6
Posts: 244
Reputation: 2,710

Post » Sat Oct 11, 2014 2:52 pm

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

trail.capx

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.
You do not have the required permissions to view the files attached to this post.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,126

Post » Sat Oct 11, 2014 3:24 pm

@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.
B
22
S
6
Posts: 244
Reputation: 2,710

Post » Sat Oct 11, 2014 4:49 pm

Wisdoms wrote: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.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,126

Post » Sat Oct 11, 2014 4:55 pm

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

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

Linkman2004's Amazingness nessness ness V2.capx


Linkman2004's Amazingness nessness ness.capx



You can do alot more amazing things with this!
You do not have the required permissions to view the files attached to this post.
B
22
S
6
Posts: 244
Reputation: 2,710


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests