Search Unity

Decal Projector Component

Discussion in 'Scripting' started by TomPo, Nov 11, 2019.

  1. TomPo

    TomPo

    Joined:
    Nov 30, 2013
    Posts:
    86
    Hi
    Question is how to get access to Decal Projector Component via script?
    I want to be able to change its size via code but no idea how to get access to it.

    It Could be via 'public' variable or via 'GetComponent' but can't find the solution.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    JBR-games likes this.
  3. TomPo

    TomPo

    Joined:
    Nov 30, 2013
    Posts:
    86
    if it was easy, I wouldn't ask ;)
    Maybe I'm missing some 'using' here.
    As for now, I can't make public DecalProjector to drag-drop from inspector.
    There is also no GetComponent<DecalProjector>() or something similar.
     
  4. MartinAlba

    MartinAlba

    Joined:
    Feb 17, 2021
    Posts:
    1
    You are probably missing the "using" relative to the render pipeline
    For HDRP: using UnityEngine.Rendering.HighDefinition;
    For URP: using UnityEngine.Rendering.Universal;

    You should be able to acces it now
     
    Last edited: Nov 27, 2022