Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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:
    36,970
    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