Shadow Clones / Trail behind an object USING ONLY FEW FRAMES

Hello :>
I’m not sure how I should implement this idea of mine… so I’m mainly asking for suggestions here.

I control that pink square. When I press certain different keys, the square dashes to a different X-location very quickly using a pathfinding-behavior. I was hoping to add shadowClones or a trail behind it to highlight the speed and traveled distance, but it turns out to be surprisingly difficult.

All tutorials I’ve seen add the shadowClones (in a trail like manner) by spawning disappearing copies of the object every frame. The problem is that my object moves to quickly that there are maybe only 5 frames of movement when jumping from far left pillar to the far right one. This leads to only 5 shadowClones that are very far from each other. It doesn’t look really good at all :confused:

Maybe some kind of thin white trail would work better, but I really don’t have currently any ideas for how to implement that. To avoid the same problem I faced with the shadowClones, the trail must be continuous. Here’s a description of an example. It describes the envisioned consequences of doing just one input - jumping from far left to far right.:

  • FRAME 1: the trail starts from the original player location (not visible since it’s under the player at this time). The key is pressed.
  • FRAME 2: the player is far from the frame 1 position. Trail expands from the frame 1 location to the current location of the player
  • FRAME 3: the player is far from the frame 2 position. Trail expands even more, connecting the original location and the current location with a continuous line.
  • FRAME 4: the player is far from the frame 3 position. Trail expands even more, connecting the original location and the current location with a continuous line. But it also lowers the opacity of the first part of the trail (which was born in between the first and second frame) so the old parts fade out.
  • FRAME 5: Same as frames 3 and 4 but this time it’s the second trail part which starts to fade out, while the opacity of the first part of the trail lowers even more.

Keep in mind that there is no reason to try to implement what I’m looking for this way, if easier solutions exists, so please share your suggestions! :> I wrote that example just to make it easier to understand what kind of visual effect I’m looking for! I’m not even sure if that kind of solution is possible in gDevelop.



I tested out @MrMen’s alternative to the tutorial from @Diven . [Tutorial] How to make platform character trail in gdevelop :) - #2 by MrMen

Speed trail test

The actual result is a bit smoother than in the gif. I made a trail object twice the width of the pink object. When it was the same width there was too much spacing between the trails. You would have to experiment with the tween time based on the speed and distance travelled of your object.



Hi! Thanks for the idea. I think it’s better, but it’s still not ideal as it is. I tried it and here’s the result:


As you can see, the gaps between the shadows are still huge. From the gameplay perspective, I really can’t afford slowing the cube down.

I tried to make the trail 5 times wider than the block too. Even then the trail doesn’t stay connected the whole way! And at that point, it starts to be too long for the smaller jumps: it starts to “leak” outside the traveled area.

Also, it doesn’t really look nice how the “trail-parts” here sometimes overlap a little. The trail should get more and more faded as we approach the end the trail. Here however, there is sometimes a little overlap in the end of the trail and this leads to sudden higher opacity, which looks a little messy.

Hi Valo, yep tricky problem. You didn’t say what the speed of your object is. I’ve increased mine to 35000 px/s to try to get it similar to yours.

When it was that fast my method clearly didn’t look good. With the same double width speed trail I added some new create actions. I don’t like it but it does improve things. But yeah, a better/different solution would be good.

Speed trail test 2

1 Like

Sorry for being unclear about the speed. I messed around a bit more with that idea. Look at this mess

I mean, it’s a little bit closer to a good one? Double width seems to not be enough for me so I increased it. I added even more creations.

I get this little gap at the very end of the dash. Maybe I should try to create a trail-part right behind me for the first few frames after stopping to fill it. And this of course demands that I keep track which direction IS behind, ugh.

Also, small dashes seem to break because we add so much trail in front of the square in order for the trail to work in large dashes!! – –

– – Actually, now that I think about it, this problem probably could just as well happen with large dashes but on the large dashes the timing of the frames just happens to be so the last frame before stopping is so far from the eventual stopping location, that instead of going over, it’s not going far enough!

Very tricky :frowning: but I’d assume this is the right path: create trail parts in multiple locations at once

Hey actually I have a little simpler idea that could look alright. I should test it tomorrow.

Maybe I can just give up on the idea that the END of the trail must fade before the rest of the trail. Maybe I should just create an object that stretches from the starting location to the middle of the square and fade out all of it right after stopping OR switching direction.

I’d imagine that this strategy won’t lead to any type of gaps.
Might lead to other problems or not look good enough, but it’s worth testing.

(thank you for your effort by the way, tremendous respect!!1!)

1 Like

Haha, let’s hope there’s a better way.

Yes, I avoided a few things because of this.

Nooooo. Haha, well if you have to. Or what if the trail object itself has a gradient from pink to transparent? But this would mean flipping it depending on which direction the moving object was going in.


Looking forward to your results, I’ll keep thinking too.


just a small little update. I said 2 days ago that I would test my idea tomorrow but I haven’t had time to do that. School deadlines surprised me. I do it when I’m able to :slight_smile: