- Home /
Set HDAdditionalCameraData from the code in runtime
Hi! I have a UIManager class where dynamically create new Camera for UI. After that I want to apply the next parameters:
var hdAdditionalCameraData = UiCamera.GetComponent<HDAdditionalCameraData>();
hdAdditionalCameraData.antialiasing = HDAdditionalCameraData.AntialiasingMode.None;
hdAdditionalCameraData.dithering = true;
hdAdditionalCameraData.volumeLayerMask = 0;
hdAdditionalCameraData.probeLayerMask = 0;
hdAdditionalCameraData.fullscreenPassthrough = true;
But. I have strange behaviour:
1. In start method var hdAdditionalCameraData = UiCamera.GetComponent(); return always null;
2. I wrapped everything into Coroutine with yield WaitUntil and await when hdAdditionalCameraData will get the component.
But it happens only if I select UiCamera game object in the Hierarchy.
So my question how I can modify HDAdditionalCameraData parameters through the code or create Cameras with different properties in runtime?
Kind Regards!
Your answer
![](https://koobas.hobune.stream/wayback/20220612234920im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Cinemachine weird lines of color when moving? 1 Answer
I need help with a model 0 Answers
Camera only displaying one object even though culling mask is set to everything 1 Answer
Terrain looks stripped 0 Answers
Game preview incorrect! 0 Answers