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 celesfar · Dec 30, 2012 at 08:41 AM · cubeplanerigidbody collision

2D/2.5D - plane collisions?

I am new to Unity. I'm working on a top-down 2.5D idea I had. The point is to do it a little bit like GTA2, where a bunch of flat sprites existed on a plane while some things (buildings for instance) were 3D.

So far I had a problem where if I made the player's "model" a plane with a rigidbody component, it would slide through the ground plane instead of colliding with it.

Making the player model into a cube works. But, it also means that all faces are rendered, which is a problem (since I can see them if the camera isn't exactly on top of the player).

But if I keep it as a plane on the other hand, will collision detection with other objects still work?

What do I do in this situation?

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
Best Answer

Answer by Fattie · Dec 30, 2012 at 08:44 AM

easy as pie!

1 - make a cube. it will be invisible. make it however thick, etc, is relevant to your work

2 - make the flat sprite. no in the Hierarchy, drop the flat sprite inside the cube - in other words, the cube is the parent of the image.

The whole thing will now bounce around (as if it is a cube) but it will look like a flat sprite (as if it's a flat sprite)

It is very common, ubiquitous, to do this in game engines. Your rigs, things, are constructed from various things stuck together, many of them invisible.

Hope it helps.

Secondly, for 2D, it is unbelievably easier to use 2DToolkit from the asset store - it is very widely used.

Comment
Add comment · Show 7 · 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
avatar image celesfar · Dec 30, 2012 at 08:51 AM 0
Share

Thanks! That's a great answer. So as I understand, just make a plane as a child of a transparent cube.

As for 2DToolkit, it's pretty cool, but doesn't look like it's got good the 2.5D style I want. Also costs $65 and I'm still testing the water.

avatar image Fattie · Dec 30, 2012 at 09:04 AM 0
Share

Hi cele - that is completely correct

"just make a plane as a child of a transparent cube"

1 - quite right

2 - I can assure that 2DT$$anonymous$$ is a perfect solution to use in titles like that. But in this economy nobody can be blamed for not wanting to spend even a few dollars immediately! :)

However just FYI it is probably realistic to say "it's almost impossible to do real 2D-containing jobs in Unity, without 2DToolkit". (or any similar competing product) It saves an unbelievable amount of time.

3 - you see how you're using a "plane" to drop sprites on. the unity example plane you are using is kind of useless - it has like 30 triangles. what you want for 2D sprites is a "simple" flat square made of two triangles, just the right shape. (indeed, this is precisely what packages like 2dtoolkit do) So in time you'll need a way to make "two triangle squares" like that!!

Funnily enough like a year ago I asked this same question, "is there a tool just like 2DToolkit, for simply making ONE flat box for a sprite" .../questions/247954/tool-to-make-one-sprite-from-a-pngtexture.html - unfortunately the answer is no

4 - funnily enough I love games with the "mixed 2D / 3D" vibe or "living paper" vibe and we work on that sort of thing a lot. I find it's basically always difficult to get just the look you want in your head. Certainly "mixed rigs" (connecting spinrgs, invisible boxes and the like) is critical! FOr example someone here was asking about a "hidden spring" solution /questions/370827/anti-gravity-vehicle-bounce-back.html

all the best

avatar image celesfar · Dec 30, 2012 at 09:46 AM 0
Share

So 2DToolkit is suitable for this? Wouldn't it limit me in that regard?

avatar image Fattie · Dec 30, 2012 at 11:50 AM 0
Share

Yes, 2DT$$anonymous$$ (or any similar product) is precisely what you use for the "sprite" part. We use it every day for "mixed" projects as discussed.

TBC such products do not "convert your app to 2D" or anything like that. It simply allows you to make 2d things WITHIN the absolutely normal Unity3D 3D projects.

Indeed I will give you a simple example - imagine you just have "a button" like floating on top of your scene. ("Buy more bombs" or whatever.)

That's a 2D thing in a normal 3D game right?

Indeed, many people use 2DToolkit (or a similar product) for every such button in all projects they do.

Don't forget - of course you CAN just use "a Unity plane" exactly like you have been doing! There's no problem with that. It's just that it uses a lot of tris somewhat wastefully, and it's inconvenient. So - good luck!

avatar image celesfar · Dec 30, 2012 at 12:27 PM 0
Share

I'll give it a go. It's a shame they don't offer trials though. :(

Show more comments

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

9 People are following this question.

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

Related Questions

Making a cube from planes, arranging planes into a box 1 Answer

Is there a way to edit the dimensions of a gameobject such as a cube or a plane? 2 Answers

instantiate works on one but not other object 0 Answers

"simplified" plane (with not so many faces/vertices) 4 Answers

Cube fall to the plane and gets Velocity 1 Answer


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