Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Set same color as another object

Discussion in 'Scripting' started by Fekzh21, Mar 23, 2019.

  1. Fekzh21

    Fekzh21

    Joined:
    Dec 29, 2018
    Posts:
    18
    How could you make an image to be set to the color of a 3d object, so the two have the same color
     
  2. WarmedxMints

    WarmedxMints

    Joined:
    Feb 6, 2017
    Posts:
    1,035
    There are a few ways of doing it. It depends on how the material is set up on the object and what shader it is using.

    You could just get the material colour, you could get the material texture and read the colours from the pixels or you could get the emission colour for example.