Why is my trail renderer flickering?

I created an empty game object and added a trail renderer to it, as is suggested in the Unity documentation, and added a rigidbody2d and a custom material (mobile —> particles —> additive) and then made it a child to the player’s game object which it will be a trail of. The problem is, anytime I run my game the trail flickers and doesn’t seem to update quickly enough. I thought it was supposed to be a constant trial that follows the player, instead it is updating maybe every three frames, if I had to guess.

To see what I mean, see my screen recording here: https://vid.me/nzUL

It is really strange because I have an fps counter on my game for debugging which says that it is running at 59-60 fps this whole time.

Does anybody know why this would be happening? I tried playing around with different textures for my material, and changed the trail renderer to interpolate, extrapolate, and neither, none of which helped. Any help would be great, thanks!

Add your cpde of your trail rendere in the “void LateUpdate()” methode

You mean the LateUpdate() method on the player object which the trail renderer object is a child of? Or on the trail renderer object itself?

On the object which handled the trail renderer through script

Thanks for the reply. However, I am not really using script to control the trail renderer. I just added it as an element to the game object through the ui. So I am not sure what code I would put in the LateUpdate() function.

Have you tried playing with the Min Vertex Distance? It may be that your object needs to move too far before the trail creates a new segment. Try setting it to a lower value.

1 Like

That was it, thanks!

1 Like