- Home /
2D Top Down Game, 2D or 3D defaults?
Hi, a friend and me are starting to build a game, the point of view would be similar to Prison Architect or Pokemon games.
A feature that we might want to add is to have holes in the ground where the player or the enemy can fall in. Also we might want to add multistory buildings in the future.
We're experienced C++ programmers but are completely new to Unity. Yesterday we started experimenting with it and had many problems setting up a simple top down scenario, to the point where we had to rotate the camera to face top down and each object we added had to be rotated manually too.
What would be the correct procedure to build this kind of game?
2D defaults without gravity, and the player moves along the X and Y axis, and we hack the holes and multistory buildings in the code? This seems like adding a 3rd dimension to the 2D.
Would it be better to use 3D defaults with 2D sprites?
We've found some information for 2D topdown shooters, but none of it uses the Unity 4.3 with the new 2D tools and we're kind of lost.
Answer by maxus · Apr 03, 2014 at 03:44 PM
Hi VLopez,
A flat, top down 2d game in unity can be implemented using sprites and unity's 2d physics api's and components. Because unity's 2d components essentially ignore the Y axis, you can't get them to change their behaviour based on the player's Y axis.
If you really want to use the 2d api, one way to implement holes would be to put your player game object on a different layer when he is in the hole, and ignore that layer when you are calculating your collisions.
To achieve this, create two layers, one called "Hole", and one called "Everything". Place two cubes on the scene in the exact same position and make sure they overlap. Add a rigidbody2d and box collider to each cube, then go to Edit > Project Settings > Physics, and edit the Layer Collision Matrix so that the Hole and the Everything layers don't collide. The result will be that the cube collisions are ignored.
Your answer
Follow this Question
Related Questions
2D Top Down Character Controller 1 Answer
Does Unity 5 support a 2D top-down view? 2 Answers
2D Topdown Shooter Enemy Knockback 0 Answers
(2d - top down) Characters drifting upon movement,Characters drifting upon movement (2d) 1 Answer
Top-down 2D: How to fly an object to a point, turning smoothly. 0 Answers