5
\$\begingroup\$

enter image description here

How can I make an effect like this? With a particle system?

\$\endgroup\$
0

2 Answers 2

5
\$\begingroup\$
  • Create a new particle system
  • In the general settings:
    • "Start Lifetime" reduce a lot. The lower, the lower the length of the particle trail. In my example I am using 0.2.
    • "Start Speed" to 0, so the particles don't move from where they were created.
    • "Simulation Space" to "World" so the particles don't move when the parent moves
  • "Emission":
    • Controls the number of after-images in the trail. In my example I increased it to 100. Should be at least 5 / StartLifetime to avoid flickering.
  • "Shape"
    • Uncheck this module, so all particles are spawned at exactly the position of the particle system
  • In "Color over Lifetime":
    • set the gradient to fade from 255 alpha to 0 alpha so the trail-sprites fade out over time
  • In Renderer
    • Create a new material with the shader "Particles/Alpha Blended"
    • Set the desired sprite as the sprite of that material
    • Assign that material to the Renderer
  • Optional: Adjust start lifetime and emission amount to taste to control length and density of the trail.

Result when you move the object:

sprite with particle trail

\$\endgroup\$
10
  • \$\begingroup\$ i cant set the color over lifeime \$\endgroup\$
    – jojo
    Mar 25, 2016 at 15:40
  • \$\begingroup\$ thanks! is there any tutorial in the material part? because i really dont know how to implement one. Sorry newbie here \$\endgroup\$
    – jojo
    Mar 25, 2016 at 15:48
  • \$\begingroup\$ @JarellGabon Creating the material is quite straight-forward, actually. In the assets folder structure, Right-Click->Create->Material, select the new material, under "Shader" pick Particles->Alpha-Blended and then drag your sprite to "Texture". \$\endgroup\$
    – Philipp
    Mar 25, 2016 at 15:53
  • \$\begingroup\$ @JarellGabon Regarding setting the alpha property of the gradient: In the gradient-editor, click the upper-right arrow and then drag the alpha-slider to zero. Screenshot. \$\endgroup\$
    – Philipp
    Mar 25, 2016 at 15:58
  • 1
    \$\begingroup\$ @FSic Maybe you would like to post an own answer explaining how to do this with the TrailRenderer component? \$\endgroup\$
    – Philipp
    Jul 3, 2019 at 7:56
2
\$\begingroup\$

You can achieve this sort of effect pretty easily. You don't have to use a particle system to do so, but it can work pretty well. The structure is:

  • You want a system that emits a single stationary particle (zero velocity) at a fixed interval.
  • Configure the particle so that it decays over whatever period of time you want (this will be the time it takes each afterimage to "fade out"), and is spawned with whatever the current animation frame is.
  • Tie the decay of the particle to it's opacity, so it gets more transparent as it approaches the end of its lifetime.
\$\endgroup\$
6
  • \$\begingroup\$ Hi dude, i get your point but im new to unity, can you give me specifics? thanks \$\endgroup\$
    – jojo
    Mar 25, 2016 at 15:39
  • \$\begingroup\$ Add unity tag then. \$\endgroup\$
    – Ocelot
    Mar 25, 2016 at 16:26
  • 2
    \$\begingroup\$ No, don't add the Unity tag. There's nothing about the question that is Unity specific; we don't want to have tons of "how do I do <the same thing> in <fifteen slightly different tools>" questions floating around. Toolset-specific answers like @Phillip's excellent post on this question are fine, and address that need well without making it exceedingly difficult to deal with duplicate questions. \$\endgroup\$
    – user1430
    Mar 25, 2016 at 16:28
  • 1
    \$\begingroup\$ @JoshPetrie Just because your answer isn't unity-specific doesn't mean the question isn't either. I find it quite unfair of you that you remove the Unity tag after I gave a very unity-specific answer. \$\endgroup\$
    – Philipp
    Mar 25, 2016 at 17:28
  • \$\begingroup\$ @Philipp I removed the tag before I saw your post, and there is still nothing in the post that is specific to Unity, nor should there be. Your answer is still perfectly valid. I'll make a post on meta about the large issue, since I can't find the discussion I thought we had on this already. \$\endgroup\$
    – user1430
    Mar 25, 2016 at 17:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .