1
\$\begingroup\$

Please see the screenshot I attached, I am trying to make skid marks using trail renderer, but one side of trail is going upwards just after it renders, it was working fine Unity 5.4, but when I upgraded it to 2017, it is behaving like this.

enter image description here

enter image description here

\$\endgroup\$
1
\$\begingroup\$

Most likely this happens because your object starting point is (0,0,0) (world origin), hence the trail is being rendered from that position too.

You should create your object to a given position rather that creating it at the origin and then moving it to another place: this way the origin will not count as a valid coordinate for trail rendering.

If that doesn't work, you can use a different approach: when the object is created, its trail has a Time value equal to 0. Next step, you can set Time to a desired value, for the very first coordinate (world origin) will not count as timing out in respect of the Time value, but the next will because the timer will be greater than 0.

\$\endgroup\$
  • \$\begingroup\$ please check another screen shot for trail renderer settings, can u suggest some values? \$\endgroup\$ – Ashok Damani Mar 26 '18 at 8:01
  • \$\begingroup\$ Time is expressed in seconds, you can tweak is value to find the best effect to fit your game. \$\endgroup\$ – liggiorgio Mar 26 '18 at 8:19
  • \$\begingroup\$ Did this answer help you? If so, you may mark it as accepted. \$\endgroup\$ – liggiorgio Apr 21 '18 at 14:46
1
\$\begingroup\$

What worked for me was to put a script on the trail gameobject, and in start() just write:

myTrails = gameObject.GetComponent<TrailRenderer>(); 
myTrails.Clear();

That's it. Trails will start fresh when they appear!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.