Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How can i create mechanism like this ?

Discussion in 'General Discussion' started by bhavinpanara22, Mar 10, 2015.

  1. bhavinpanara22

    bhavinpanara22

    Joined:
    Jul 5, 2013
    Posts:
    126
    Hello,

    I would like to know, how can i create mechanism like this game.

    http://www.kongregate.com/games/player_03/run-3

    See, when you collide at one side, then world gets rotated automatically.
    How can i build this in unity ?

    Thanks.
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Sorry about that, game is pretty good, especially for a Kongregate offering. Would have come back sooner, but I had to get to about level 20 before I started dying enough to make it bearable to leave.

    The underlying mechanics are really simple. Note that the player never leaves the centre of the view port, the entire level moves and revolves around him. So build some colliders, and stream them past the player. Every time the player contacts a collider rotate and move the scene to put that collider under the players feet. And your done.
     
  3. bhavinpanara22

    bhavinpanara22

    Joined:
    Jul 5, 2013
    Posts:
    126
    @BoredMormon ,
    hello,
    I know, that player will never leave his/her place in any infinite game.
    But i don't know, how can i rotate the whole world according to the side player has touched ?
    Should i put all game objects under one parent gameobject, then rotate the parent ?
     
  4. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    That's the easiest way. Locate the parent at the centre of the screen so everything rotates nicely.