- Home /
Fixed size trail renderer
I am working on SFCave 2d game. For this I am using trail renderer to show line behind player. At present I have implemented basic functionality of trail renderer and it is working fine.
Now I want following changes in basic trail renderer.
I always want fixed size trail renderer not change size of tail based on position
At start of game, right now there is no trail drawn but I want some specific size trail to be drawn at start also.
In original game there is dotted trail is created so for implementing this what is the basic concept?
Please give some suggestions in this. If any market plugin can help me in this then suggest this also.
@siddharth3322 : Did you managed to achieve this trail?? If Yes Plz help me out with the same.
No at present I can't able to figure out solution for this problem.
Answer by SkillcraftHD · Sep 09, 2021 at 04:06 PM
Hey there, I've also got the same issue like you, here's the answer I came up with (actually pretty simple): Create a new script and add it to the gameObject:
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. @siddharth3322
Your answer
Follow this Question
Related Questions
Tail behind player 0 Answers
On start display trail renderer 0 Answers
Brighter Trail Renderer 2 Answers
Trail behind standing player 1 Answer
[Solved] How to correctly use TrailRenderer.GetPositions 1 Answer