Search Unity

Question about how to implement a per model hit effect.

Discussion in 'General Graphics' started by Yukken, Jun 21, 2020.

  1. Yukken

    Yukken

    Joined:
    Jul 12, 2015
    Posts:
    93
    I know how to animate the material.
    But the hit effect of each enemy should be independent.
    Should I copy the material in runtime and set it as renderer.material? Is there a performance cost for that?
     
  2. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    350
    Try MaterialPropertyBlock.
     
  3. Yukken

    Yukken

    Joined:
    Jul 12, 2015
    Posts:
    93
    Thanks. I can't believe I didn't find this sooner.