Search Unity

Infinite scrolling "mesh"

Discussion in 'World Building' started by KasunL, Sep 22, 2021.

  1. KasunL

    KasunL

    Joined:
    Apr 19, 2015
    Posts:
    64
    Hello.

    I'm creating an air craft game and I wanna create an effect similar to 2001 movie's Dave flying into the monolith sequence -- Where you infinite scroll two graphics (mesh-looking ones in this case) on each side of the aircraft, giving the illusion of flight. I have done 2d infinite scrolling background effects, but I'm not sure how to do it in 3d space. Anyone got pointers, tutorials, etc, to get started?

    P.s Currently what I've got is a spacecraft (Cockpit view) and asteroids coming from front to hit it. The intention would be to keep avoiding the debris.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Ah, this is much easier than you think it is! Just throw up two planes with a mesh texture on them. Then on each frame, update the UV offset on the material by a little bit. Presto, scrolling mesh!

    See the "Scrolling UVs" script on the wiki for sample code: https://wiki.unity3d.com/index.php/Scrolling_UVs
     
    KasunL likes this.
  3. KasunL

    KasunL

    Joined:
    Apr 19, 2015
    Posts:
    64
    Thanks for the input! I'll check that out
     
    JoeStrout likes this.