- Home /
Question by
Rocknglory · Dec 27, 2015 at 10:14 AM ·
unity 5gamegraphicstrailrenderertrail
Custom trail fixed length and custom form
Hello guys!
Here is my problem. I need to achieve effect like on the pic attached. The white trail is trail like with builtin trail renderer, but it has custom form, and fixed length all the time. How can i achieve that? I guess I need to write custom trail renderer, which will spawn meshes with the desired form. Anyone can help with that?
Comment
Answer by SkillcraftHD · Sep 09, 2021 at 04:05 PM
For the fixed length: private void Update() { trailRenderer.time = Mathf.Abs(1f / rb.velocity.magnitude); } This basically just checks the current speed the rigidbody has and then turns the time around to make if fit the current velocity magnitude. @Rocknglory