• 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
Question by fantom642 · Feb 14, 2015 at 11:03 PM · physicscolliderphysics2dunity 4.6unity4.3

2D physics settings for solid 2D objects with polygon collider

I have recently updated Unity from 4.3 to 4.6. Unfortunately, when I opened my 2D game project, the behaviour of 2D physics changed too, resulting in significant gameplay problems (for instance items are more squeezable)

So my question is simple: Is there any combination of physics 2D settings in 4.6 that gives exactly the same behaviour as the physics 2D in Unity 4.3?

The difference is highlighted here:

The first one is in 4.3: it works OK. The second one is in 4.6: the same project, but now the behaviour is different:

http://imgur.com/a/qnxBV#0 http://imgur.com/a/qnxBV#1

I am using simple hexagonal grid and I am generating new elements from the bottom.

Comment

People who like this

0 Show 5
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 _dns_ · Feb 14, 2015 at 11:40 PM 0
Share

I'm not sure I understand: Can you be more specific about "more squeezable" ? What kind of colliders, what is happening vs what was happening etc...

A guess: in 4.5 the transform hierarchy order was changed: it's now sorted "by transform" instead of alphabetically. Maybe the order some objects are updated changed, causing more penetrations (is that what you mean by squeezable ?). Maybe the physics 2D projects settings were not correctly converted ?

avatar image fantom642 · Feb 15, 2015 at 09:42 AM 0
Share

I am making tetris-like game, where instead of tetris bricks, there are hexagons falling down and they kind of stack on each other. But on the higher levels, the hexagons seem to be affected more by gravity and "squeeze" the ones below them. I am using polygon collider with hexagon shape.Look at the image, first is ok (4.3), second is the same project but migrated to 4.6: alt text

it shows levels (floors) around 8-11

physics.png (14.2 kB)
avatar image fantom642 · Feb 15, 2015 at 03:51 PM 0
Share

I have updated my question with example GIFs. Again it's exactly the same project, the same files, the same scripts, the same variables. Anti-aliasing difference can also be seen there.

avatar image _dns_ · Feb 15, 2015 at 05:02 PM 0
Share

Ok, this is due to more penetration between objects. If it's caused by some changes in the physics engine then it's difficult to know exactly why...

Did you try changing the project's physics2D settings ? Maybe increasing or decreasing some number of iterations or tolerance could help. Also decreasing the fixed update delta time in the time settings could help but will have an effect on performances.

A more general remark: that's a lot of colliders, and the polygon colliders is an expensive one! The way the colliders are stacked is kind of a worst case too for physics engine (lots of contacts all the time) so I'm surprised that it works so well with 4.3. If it's a tetris-like gameplay, it might be faster to move the objects with a script that will simulate some physics behavior but without real physics, like it's done in tetris. If it's possible, this would be faster on mobile devices.

Well, I'm sorry I can't help you more here. Maybe people in the physics section of the forums could help ?

avatar image fantom642 · Feb 15, 2015 at 05:31 PM 0
Share

Well yeah, that's actually the question itself: what values should be increased/decreased (there are many new). Even the documentation for 2d physics settings is not up to date.

I am, of course, using scripts to simulate same features, but I wanted to hightlight the difference in physics2d in two different versions so I made this simple example with no scripts having much effect on the physics.

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Using collider to gameobject detect attack or not 2 Answers

Is it possible to rotate a 2d collider in 3d? 0 Answers

Creating 2D collider from 3D mesh 0 Answers

Reset Rigidbody2D rotation after collision 2 Answers

Colliders2D not working under same parent? 2 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