Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by VLopez · Dec 05, 2013 at 01:28 PM · 2dtopdown

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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.

More info on layer collision matrices

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges