Search Unity

Feedback Density in PhysicsMaterial(2D)

Discussion in 'Physics' started by NecroJack, Mar 25, 2019.

?

Where would Density fit better?

  1. In PhysicsMaterial(2D)

    50.0%
  2. Where it is (Explicitly set in the Collider info)

    0 vote(s)
    0.0%
  3. Both in PhysicsMaterial, and in Collider, with Collider's density overriding the PhysicsMaterial's

    50.0%
  4. Both in PhysicsMaterial, and in Collider, with PhysicsMaterial's density overriding the Collider's

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. NecroJack

    NecroJack

    Joined:
    Mar 25, 2019
    Posts:
    1
    Hello.

    This is a though I had and I'd like to share it, as a Feedback / Suggestion for Unity.

    In short (for TL; DR; :p), I believe "PhysicsMaterial2D" should hold the Density value
    (rather than setting it explicitly? Or maybe keep both with explicit overriding the material).

    I was building a 2D game with some asteroids.
    I had 4 large asteroids, 4 medium and 4 small.

    It made sense to make larger asteroids have a greater density than medium and small ones,
    since in 3D they would get greater mass because of their Z axis (which is not present in 2D Games).

    So I went and created a "base Prefab" "Meteor", with no Collision Shape,
    because leaving a PolygonCollider2D without a Collider/Polygon displays an error,
    and with the intention of providing one on each variant prefab created by the "Meteor".

    What I found out is that on every one of them I have to set a density. And the density is to be set
    in the the Collider.
    What I also saw was that Friction and Bounciness could be set in materials. So it would be enough for me
    to set a material, drop it on all asteroids of the same size, and have the friction and bounciness be set...

    But, if only Density was set the same way, I wouldn't be in the need of setting it explicitly.
    It would make more sense that I would set the meteorites to "Large Meteorite" material and have them
    have their density defined by that, rather than having to address every "Meteorite" on it's own...

    What I'm saying is: Large meteorite should have a density, Medium meteorite another,
    and so does small ones. It makes more sense for me to have density set in PhysicsMaterial2D.
    I'm saying only for "PhysicsMaterial2D" and not "PhysicsMaterial" because I have worked only with 2D :)

    I can think of another example:
    I change the PhysicsMaterial2D of my ball, to make it from Heavy metallic to be made of wood...
    Well, none would expect it to have the same density, would we?
    But one would have to change it's density explicitly as Unity works now.
    But it does makes sense (for me at least), that when I change the material of something,
    its density changes with it.

    So, that is my feedback,
    thank you for this great tool :)
    thank you for the forums and the ability to post feedbacks,
    keep up with the good work :}

    Alexander

    P.s.: Sorry for taking the initiative to even add a Poll, since it may be silly, it may just be clutter and even start a debate :d ... but I'm really curious to see towards which side opinions incline :)