2

I'm trying to change the bloom color (PostProcessing) via a script. In the inspector the color changes but not in the game view. Some help, please.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;

public class PostProcceserManager : MonoBehaviour
{
    PostProcessVolume volume;
    Bloom bloomLayer;

    public ColorParameter [] ColorArray;

    private void Awake()
    {
        volume = gameObject.GetComponent<PostProcessVolume>();
        volume.profile.TryGetSettings(out bloomLayer);
    }

    private void Start()
    {
        //change the color
        volume.enabled = true;
        ColorParameter x = new ColorParameter();
        x.value = Color.red;
        x.overrideState = true;
        bloomLayer.color = x;
    }
}
ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
Falafel_Truck
  • 41
  • 1
  • 4
  • There is a similar question here: http://answers.unity.com/answers/1483341/view.html you should try doing exactly what they do and see if that works for you. I notice that they do `bloomLayer.enable = true;` but you never do. Maybe you should try that, also when it comes to the effect only displaying in the editor but not in-game, maybe that is a strange setting that you can set in the unity editor, try looking above the editor/game windows and see if there is any checkboxes you can alter. Good luck! – Issung Nov 01 '19 at 00:44

0 Answers0