Instantiating lowers framerate

My game is a tron-like game in which there is a trail behind the player and if another player walks into it they die. To do this I instantiate invisible cubes behind the player. This works fine but after a while the framerate starts to get lower and lower if the player is moving. If the player is not moving the frame rate goes back to normal. Is there any other way I could instantiate the cubes without lowering the framerate lowering? Or having a colidable trail?

	void Update() {
		if(rigidbody.velocity.magnitude > 7){
			Network.Instantiate(collidie, transform.position + -transform.forward, transform.rotation, 0);
		}
	}

I am guessing you are using a prefab (collidie), add a script into it,

void Awake() {
     Destory(gameObject, 5);
}

this will destroy your cube after 5 seconds, and your memory won’t be filled with old objects.

If you create them too fast, without a time limit between two instantiate time, you need to add that too.

Lastly, you may want to look into polling.

Instantiate is a slow, expensive function. Get used to it. Destroy will also cause you problems.

The best solution is object pooling. Google it. Or check out some of the premade scripts on this answer.