- Home /
Any way to pause the Trail Renderer ?
Hi, I'm trying to pause a Trail Renderer to hide it when the object is teleporting, but the Clear() function deletes the hole trail, that's not what I want :/
Also, when I change something on the Trail Renderer it's always executing before the teleportation so it's useless..
Here's what it looks like for now :
https://youtu.be/qT01h7qJQNQ
Here's the code running in the video :
void Teleport(Vector2 pos){
transform.position = pos;
GetComponent<TrailRenderer>().Clear();
}
I'd like the trail to do something like that :
Answer by hexagonius · Sep 17, 2018 at 09:34 PM
You'll have to start a new trail renderer every time you want a new line to appear. Another approach would only be to alter the width curve so it maps exactly to the trails length at any time and insert and move points in there programmatically that reduce the with to zero.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Limit & Scaling Translation Rate. 0 Answers
Make a GameObject a Child of What it Collides With 2 Answers
One Key press to trigger .MoveTowards to go through its whole movement. 2 Answers