I add a TrailRenderer to a moving GameObject,but when I use
Time.timeScale = 0,it stops everything except for TrailRenderer,it just
become a staight line through the Object moving direction,
So,is it a bug or How can I stop this effect.
I add a TrailRenderer to a moving GameObject,but when I use
Time.timeScale = 0,it stops everything except for TrailRenderer,it just
become a staight line through the Object moving direction,
So,is it a bug or How can I stop this effect.
As to how you can stop the effect, consider the following code as an option. All it does is get the TrailRenderer component and modify the line width to 0 so there is no visual effect.
public GameObject obj; //The GameObject with the TrailRenderer attached
//Using this next piece of code will make the visuals disappear:
TrailRenderer trail = obj.GetComponent("TrailRenderer") as TrailRenderer;
trail.startWidth = 0;
trail.endWidth = = 0;
Keep in mind you could also just disable the component as a workaround as well, which may save a tiny bit on memory.
As to why the trail is still visible when you scale time to 0, I can’t confirm whether it is a bug or just your scene setup without more details and code samples.