Skip to content

Question: Material Instance is automatically attached to multiple objects. #11835

@hwstojimaryuta

Description

@hwstojimaryuta

Environment

UnityEditor version: 2022.3.42f1
Version of MRTK: 2.7.3.0

Problem

  • Material Instance is automatically attached to multiple objects.
  • Material Instance is attached again to an object to which Material Instance is already attached, and two Material Instances are attached to one object.
    In this state, the processing of Material Instance increased and the load on Unity increased.
    Currently, the load is temporarily reduced by deleting the Material Instance of objects that do not change material in scripts.

Questions

  1. Which operations cause automatic attachment of Material Instance?
     I have verified the possible parts in my environment, but could not reproduce the problem.
     The following are the assumed verification details.
      - Duplicate the object.
      - Change to a different material.
     Also, EnsureComponent() automatically creates a component when there is no MaterialInstance, so I checked the script I implemented, but it was not used.

  2. Tentatively, I am trying to reduce the load by deleting the Material Instance component of the object that does not change material in the script. If this is incorrect, I would like to know the correct way to handle this as well as the negative effects of not having Material Instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions