Search Unity

Infinite 2D background that alternates between multible parallax backgrounds

Discussion in 'Getting Started' started by arwidsjodin, Jul 13, 2020.

  1. arwidsjodin

    arwidsjodin

    Joined:
    Jul 13, 2020
    Posts:
    1
    Hey, I haven't been able to find anything about this topic online so I'm making my own post asking for help.

    I'm trying to create an infinite 2D background that will swap between different parallax backgrounds. To be exact I want 3 parallax backgrounds to be used 1 by 1 until x=3000 and then a 4th background to be used infinetely starting from that point.

    From x=0 -> x=1000 I want the first background to be shown.
    2nd background from x=1001 -> x=2000
    3rd background from x=2001 -> 3000
    4th background from x=3001 and onwards infinetely

    This tutorial shows how this can be done with only 1 parallax background:
    .

    On my own I haven't been able to get further than what is shown in that tutorial but I have 2 ideas that I'm trying.

    Idea 1
    4 backgrounds working exactly the same way but being active and shown at different x positions

    Idea 2
    Have 3 finite parallax backgrounds and then 1 infinite background that will be visable when the 3 finite backgrounds are no longer visable.


    Any comments or suggestions would be greatly appreciated.
    Thank you for reading this.