mathf.repeat

hey guys
By using mathf .repeat we can create a geme with infinity backgrounds.
My question is how can one do that when the camera returns, the image is replaced by a random one?

I’d say you probably want to re-implement Mathf.Repeat to be able to react to the loop happening. It’s not hard at all:

while(camera.position.x > maxX)
{
  camera.position.x -= maxX;
  // do additional stuff here, like
  background.sprite = anotherSprite;
}