1
\$\begingroup\$

I would like to make a trail for a pixelated snake such as this one :

enter image description here

As you can see, the cross simply repeats itself to create the snake. In Unity I have messed around with Trail Renderer, tried everything to import the cross as a texture / sprite, then created all sorts of materials for it, but it just won't work the same way.

How can I achieve this effect please? Thanks!

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

I am afraid that the effect which you desire won't be able to achieve through Trail renderer. I had once accidentally achieved it while playing with multiple cameras. What you need is to stop the camera from clearing the render buffer before drawing a new frame. So that the cross at last position remains as is and the new cross gets drawn on top of it . This doesn't affects the draw calls or performance, as it is just refraining the buffer from clearing. You need to play around with Clear Flags settings for camera , and set it to don't clear.

\$\endgroup\$
3
  • \$\begingroup\$ Well that does it, but it sort of creates the effect for everything rendered by the camera. What if I wanted just that specific cross, while other things in the scene don't leave behind such a trail? \$\endgroup\$
    – Zee
    Commented Aug 22, 2015 at 13:17
  • 1
    \$\begingroup\$ You could only allow the second camera to display the layer containing your cross pattern. \$\endgroup\$
    – Savlon
    Commented Aug 22, 2015 at 14:28
  • \$\begingroup\$ Yes savlon is right , assign the object for which you want the effect to take place to a different layer and select that layer in the camera's culling option. \$\endgroup\$
    – Hash Buoy
    Commented Aug 22, 2015 at 15:01
0
\$\begingroup\$

ONE method could be using an object with a particle system. Manage the particle system the right way , controlling it by script, spamming ONE particle based on object moviments. Use the cross ad particle texture..

\$\endgroup\$

You must log in to answer this question.

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