Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to build a 2d sidescrolling game

Discussion in 'Community Learning & Teaching' started by Vahn, Jan 5, 2013.

  1. Vahn

    Vahn

    Joined:
    Jan 3, 2013
    Posts:
    4
    Hi guys,

    i'm new to unity, i've followed some tutorials, but everyone says something different, or uses something different.

    I would really like to know which steps i need to make to build a 2d sidescrolling game like "The Swindle"
    http://www.sizefivegames.com/wp-content/uploads/2012/09/Swindle_01.png

    or something similar. I'm a little prepared in programming, but what i can't understand is which technique i have to use

    for example, how i build the level? I make tiles? Or i have to make everything in blender? This is just one question...so i will really appreciate any kind of help

    Thank you ;)
     
  2. GooseNinja

    GooseNinja

    Joined:
    Sep 14, 2012
    Posts:
    45
  3. Vahn

    Vahn

    Joined:
    Jan 3, 2013
    Posts:
    4
    thanks for the answer! i've given a look at those links. But i have another question...is the "ground" of this game made tile by tile? Which is the fastest way to create an entire tile map? I have to draw every single tile...or i can draw an entire level and subdivide it later?
     
  4. Vahn

    Vahn

    Joined:
    Jan 3, 2013
    Posts:
    4
    however i've tried to do something and learn how everything works. But the colliders with the player and the ground are not so accurate as i thought. I've set up the custom polygon collider (with 2dtoolkit) for both object

    this is what i get

     
    Last edited: Jan 5, 2013
  5. GooseNinja

    GooseNinja

    Joined:
    Sep 14, 2012
    Posts:
    45
    I don't think that the ground is tiles by tile but rather piece by piece. And the colider on the ground seems to be a box that goes around the entire ground piece. I cant remember how 2dtk works but they do have some simple tutorials that should be able to get you going
     
  6. Vahn

    Vahn

    Joined:
    Jan 3, 2013
    Posts:
    4
    thanks! :D

    however i've solved the collision problem by removing the "character motor" script. I don't know why it disturbed collisions. However the motor script was not working...i think i will write a movement script by myself. I will have to link the maincamera with my player movement onto the script?
     
    Last edited: Jan 6, 2013
  7. GooseNinja

    GooseNinja

    Joined:
    Sep 14, 2012
    Posts:
    45
    Are you using a character controller on the character? you should try using rigidbody on him instead and write a script with transform.translate to move him. And with the camera you could just drop it on to your character in the hierarchy panel