Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    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:
    7
    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,390
    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:
    7
    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:
    5
    @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,390
    Oh okay, I can only speak for 2D physics. For 3D physics @yant would know more.
     
  6. MenteBacata

    MenteBacata

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