Search Unity

Incorect physics 2D behaviour of scaled down primitives

Discussion in '2D' started by madfatcat, Jul 12, 2014.

  1. madfatcat

    madfatcat

    Joined:
    Jul 3, 2014
    Posts:
    14
    I faced the strange 2D physics behaviour in my project. All I do is: click GameObject => Create Other => Sphere, then I remove Sphere Collider component in the inspector, add Circle Collider 2D, add RigidBody 2D and scale down the sphere in the editor to 0.3. Then I create two cubes and replace their Box colliders with Box Colliders 2D. That's everything I do. You can see how the created sphere behaves on this video: http://madfatcat.com/00/strangePhysics.mov . I didn't change neither project's physics settings nor any other sphere gameobject's settings.

    Note: this is happened only when I scale down the sphere. When the scale == 1, the sphere behaves correctly, but once I reduce the scale to, say, 0.3, I see the incorrect physics behaviour. Furthermore, I just realized the scaled down sphere's behaviour is incorrect in the Unity IDE and on iOS devices, but not in web player! Can please someone just repeat the steps described above in a blank project and let me know how everything is working? Don't forget to scale down the sphere to 0.3. I have Unity 4.5.1f3 basic license for mac.
     
  2. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    Interesting. Looks like rotational inertia is way too high. I wonder if the rotational inertia calculation isn't accounting for the shrinking sphere? Have you tried reducing Rigidbody2D.inertia proportionally?
     
  3. madfatcat

    madfatcat

    Joined:
    Jul 3, 2014
    Posts:
    14
    Thanks Pyrian, looks like inertia calculation doesn't take into account the scale. In my case it was 1.1, I set it to 0 and things became much more realistic. However, this seems to be a glitch, should I submit it anywhere?