/* * We need to spawn food at another location as well as increase the size of the snake */ void OnTriggerEnter(Collider other) { /* * Adding a snake body position at the current food position */ player.AddSnakeBodyPosition(transform.position); /* * Spawning food at a new location */ SpawnFood(other.transform.position); }