Lag ingame

I’m doing a simple snake 3d game, but sometimes the snake start teleporting and leaving ghosts, but if I just stop and play again the problem may or may not appear.

The build may also bugs, and it will have the same problem no matter how much times I play, but I can build again and the problem will be gone.

I did a bugged build now, you can check it here:

www.disturbedprogrammer.com/files/snake_eric.unity3d

What may be causing this?

Thanks in advance.

I found the problem, my camera movement was being updated every Update() function call, but my movement was time-Dependant.

I made the movement function call the camera update and now everything seems fine.

Thanks.