TrickyTrailRenderer

Hi there,
I have a sidescroller where my player only moves up and down. The background moves along X, right to left. I want to use a trail Renderer, however, since my player only moves up and down, so does the trail. Is there a way to create a trail, not along his flight of path (y), but along x? I know it will be some type of trick, but I am not sure what yet.

Thanks.

You’ll have to code your own trail renderer or use shuriken.

I looked at the component, I even tried to open the script, but was unable to access it or open it from the editor in MonoDevelop. I am wondering, since I have Unity basic, perhaps you are not allowed to access these? Also, after looking at the reference page I see no relevant vars I can use in the component to create what I need.

So, I am wondering, do you have any more detailed suggestions that would guide me in the creation of some type of effect that will help. I think a line renderer, would probably be best for this case. If you have any hit ideas, please suggest them

Cheers.

The built in Unity components aren’t editable like that (even in Pro) to ‘code your own’ you’d have to replicate the functionality yourself.

Luckily, you should be able to do exactly what you want with the Line Renderer pretty easily.

Generate a line going from your ship to however far off screen you want it, make sure it has, say 50 points, strung out evenly along it’s length. at a set interval (maybe every FixedUpdate) you set point 50 to point 49’s position, point 49 to point 48’s position […] point 2 to point 1’s position, then set point 1 to the position of your ship. (obviously do this in a loop :wink: )

The result should be a trail that ‘changes’ from the point of the ship then scrolls away from it. If it scrolls too fast or slow, adjust the number of points.

Thanks FlaxSycle, I will give it a try.