How do I make a bullet trace effect like in Mr Bullet?

0 favourites
  • 11 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Hi guys,

    It might be easy, but i actually don’t know how to do that Bullet trace effect like Mr Bullet

    I tested with particles but its not like this.. i love how the trace breaks when the bullet change the direction

    Here is a link to the game:

    youtu.be/jmLEA4oOTug

    Any creative out there to help my at this? Thanks in advance 🙏

  • See this demo:

    https://www.dropbox.com/s/3frt5exad5tt3ec/BulletTrace.c3p?dl=0

    thank you dop2000 it works! Do you have another soution? Its very cpu and gpu intensive

  • It's not that bad, on my laptop the trail adds about 5-10% to cpu utilization, gpu is at 0%. On a very old phone it adds 15-25% to cpu.

    .

    You can decrease fade out time, this will make the trail shorter, reduce the number of trail sprites and improve performance. You can also spawn trail sprite not on every step, for example skipping 2 in 3 steps.

    Another solution is to use just one object for each trail line, changing its width on every tick instead of fading, but this may be a bit more complicated.

  • It's not that bad, on my laptop the trail adds about 5-10% to cpu utilization, gpu is at 0%. On a very old phone it adds 15-25% to cpu.

    .

    You can decrease fade out time, this will make the trail shorter, reduce the number of trail sprites and improve performance. You can also spawn trail sprite not on every step, for example skipping 2 in 3 steps.

    Another solution is to use just one object for each trail line, changing its width on every tick instead of fading, but this may be a bit more complicated.

    The problem is, that i am working right now on C2 (i have C3 too, but i can not change the whole project) and i dont have stepping there... Any other solution for C2?

    Thanks budd

  • Then you shouldn't have posted this in C3 forum :)

    Here is a version that doesn't use bullet stepping.

    dropbox.com/s/7tfobtbs6vqwoud/BulletTrail3.c3p

    It's not so nice looking, may require additional tweaks.

  • Hey dop2000

    for some reason your c3p is just showing me a white screen with a red dot on it.

    anyway unleashedstudio

    I would say, looking at that game slowed down, what you have there is a "snake" following the bullet.

    i.e. make a very long side on triangle sprite that fades right to left. Cut it up into say 10-20 pieces.

    then use these pieces in the frames of a sprite as the segments of a snake that follows the bullet around.

    There should be a few snake examples on here somewhere. Generally it involves making an array for each bullet to record its positions at certain intervals as it moves. Then use these recorded coordinates to set the position , angle and length of each segment sprite every tick so they follow along after the bullet. as you will have a higher frame number the further the segment from the bullet it looks like it is a tracer fading away.

    I could be wrong, there are a few ways to achive the same effect, but anyway another idea to try.

  • Thank you all!

  • NetOne You are probably previewing the wrong layout :)

    Run "Layout 1"

  • dop2000

    I see,,, noob mistake

    here, I tried the snake idea. (cos its more interesting than working on my own game!)

    its very rough but its nearly there. and you can fire unlimited bullets. small issue which I cant figure out the line sometimes bends between hits, maybe need bullet step for more accuracy or more segments.

    drive.google.com/open

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • here, I tried the snake idea. (cos its more interesting than working on my own game!)

    Yeah, that's why we are all here :)

    Your example looks nice!

    I stole your trace sprite with fading frames, and updated my demo for multiple bullets:

    dropbox.com/s/7tfobtbs6vqwoud/BulletTrail3.c3p

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