Quantcast
Channel: Questions in topic: "post processing"
Viewing all articles
Browse latest Browse all 713

Accessing PostProcessing Profile Settings from script URP error. 2020.2.7

$
0
0
(2020.2.7)(URP) I'm trying to make a dynamic depth of field effect. I have not imported any postprocessing assets from the package manager instead im using the global volume component on an empty game object. I have a volume profile linked to it which has a depth of field override which is set to the bokeh mode. I made a new script and attached it to the camera using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; public class DepthOfField : MonoBehaviour { DepthOfField comp; public Volume volume; void Start() { volume = gameObject.GetComponent(); volume.profile.TryGet(out comp); } } I get an error on > volume.profile.TryGet(out comp); Which says >The type 'DepthOfField' cannot be used as a type parameter 'T' in the generic type or method 'VolumeProfile.TryGet(out T)'. There is no implicit reference conversion from 'DepthOfField' to 'UnityEngine.Rendering.VolumeComponent'. Please Help!

Viewing all articles
Browse latest Browse all 713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>