Search Unity

Postprocessing using directory not showing UP in URP Template

Discussion in 'Scripting' started by AtlasThalassa, Jul 6, 2020.

  1. AtlasThalassa

    AtlasThalassa

    Joined:
    Jul 6, 2020
    Posts:
    4
    Hi :)
    I'm trying to make changes to my Prostprocessing on runtime like Vignettes when gettin hit etc.
    The Postprocessing works finde and i imported it through the Package Manager. But whe i'm trying to use it in my script it can not find the Postprocessing using directory. First i thought i was just a Visual Studio Code bug. But when i save it anyway Unity throws me an error.
    I'm using the Unity URP Template.

    Can someone please help, it makes me crazy :/
     
  2. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,605
    I personally can not help you with this, but to save the person who can some time: please post the error message.
     
  3. Terraya

    Terraya

    Joined:
    Mar 8, 2018
    Posts:
    646
    here you go:

    Code (CSharp):
    1. using UnityEngine.Rendering;
    2. public Volume postProcessing;
    3. postProcessing.profile <---
    and there you can modify its further data :)
     
    AtlasThalassa likes this.
  4. AtlasThalassa

    AtlasThalassa

    Joined:
    Jul 6, 2020
    Posts:
    4
    UUh thank you. I will try it when i'm back from work! :D
     
  5. AtlasThalassa

    AtlasThalassa

    Joined:
    Jul 6, 2020
    Posts:
    4
    Hey everyone @Terraya i have tried you tip but it still struggeling in the using directive i guess (Sorry for answering now. My notebook was broken and i had to wait untill they fix it):

    Assets\Scripts\Camera\PostProcessingController.cs(9,13): error CS0246: The type or namespace name 'Bloom' could not be found (are you missing a using directive or an assembly reference?)

    Here the code:


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Rendering;
    5.  
    6. public class PostProcessingController : MonoBehaviour
    7. {
    8.     public Volume postProcessing;
    9.     private Bloom _Bloom;
    10.     private Vignette _Vignette;
    11.  
    12.     void Start() {
    13.         postProcessing.profile.TryGet(out _Bloom);
    14.         postProcessing.profile.TryGet(out _Vignette);
    15.     }
    16.  
    17.     void Update()
    18.     {
    19.      
    20.         _Bloom.intensity.value = 1;
    21.         _Vignette.intensity.value = 1;
    22.     }
    23. }
    24.  
     
    Last edited: Aug 4, 2020
  6. AtlasThalassa

    AtlasThalassa

    Joined:
    Jul 6, 2020
    Posts:
    4
    Ok I managed it to work. The solution was quite stupid/simpel.


    using UnityEngine.Rendering.Universal;