Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Default Material in Physics Manager: How it is supposed to work?

Discussion in 'Physics' started by MenteBacata, Jun 14, 2018.

  1. MenteBacata

    MenteBacata

    Joined:
    Dec 20, 2016
    Posts:
    10
    Hi everyone,
    setting the default material property in the physics manager seems to have no effect.
    The documentation says:
    So i would expect that every collider with material set to 'none' would have assigned the default material I specified in the physics manager, but it doesn't work that way.
    After hitting play all unassigned materials are still 'none' and if i try to access them via script I get the Default (Instance) material which is not what I set as default material.
    This isn't something I noticed just now (I'm on Unity 2017.4.3f1), I rember having the same issue back on Unity 5, but now I have reached a point in my project where this feature would really come in handy.
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    1,530
    I presume you're talking about 2D physics?

    Anyway, it doesn't mean it physically assigns the material but rather than the Rigidbody2D or Collider2D uses the default material.

    The way it works is that a Collider2D looks to see if it has a material assigned and uses it if so. If not it looks to see if the Rigidbody2D it is attached to has a material assigned and uses that if so else it uses the default material on the physics manager. It does not copy the material and assign it to the property.
     
  3. MenteBacata

    MenteBacata

    Joined:
    Dec 20, 2016
    Posts:
    10
    Actually I was talking about 3D physics, however I think I got it now.
    Still I think there is an issue:
    When a script reads a collider's material which is unassigned, it automatically assigns 'Default (Instance)' to the material property which is different from the default material set in the physics manager and then the physic properties of the collider are changed.
     
  4. laurencew

    laurencew

    Joined:
    Jul 24, 2012
    Posts:
    7
    @MelvMay I am also seeing this behaviour, where the assigned "Default Material" in the physics manager isn't assigned to 3d colliders instantiated at runtime. Is this feature 2d-only now?
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    1,530
    Oh okay, I can only speak for 2D physics. For 3D physics @yant would know more.
     
  6. MenteBacata

    MenteBacata

    Joined:
    Dec 20, 2016
    Posts:
    10
    No problem, thanks anyway.
     
  7. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    206
    Can you see any properties that are different in the default (instance) material compared to the one described in the physics properties? If yes, report. I remember there were a few some years ago and we fixed that. Thanks.
     
  8. MenteBacata

    MenteBacata

    Joined:
    Dec 20, 2016
    Posts:
    10
    Hi,
    yes, properties are all different. It seems that the default (instance) material is the unity default one.