Forum rules - please read before posting.

SC Post Effects Global Post-Process Volume not working in build

So, I have an SC Post Effects plug in that has an array of effects using Global Post-process Volumes - l have tweaked a script so that when a character (in this instance the Narrator NPC) speaks, the effect is played. This plays in scene but not in my build. Other global effects called normally work in both editor and build. The code is below, any ideas why this might be?

Thanks

using UnityEngine;
using UnityEngine.Rendering;
using AC;

[RequireComponent(typeof(Volume))]
public class SpeakerSpeedLines : MonoBehaviour
{
    public Volume volume;
    public Char speaker;
    public float blendInSpeed = 4f;

    public AnimationCurve intensityCurve = new AnimationCurve(new Keyframe[]
  {
        new Keyframe(0f, 0f), new Keyframe(0.5f, 1f), new Keyframe(1f, 1f)
  });

    private SCPE.SpeedLines _speedLines;
    private float _progress;
    private bool _speaking;

    void SpeechStarted(Speech speech)
    {
        if (speaker != speech.GetSpeakingCharacter())
        {
            return;
        }

        _speedLines.active = true;
        _speaking = true;
        _progress = 0.0f;
    }

    void SpeechStopped(Speech speech)
    {
        if (speaker != speech.GetSpeakingCharacter())
        {
            return;
        }
        _speedLines.intensity.overrideState = false;
        _speedLines.intensity.value = 0f;
        _speaking = false;
        _progress = 0.0f;
    }

    private void OnEnable()
    {
        EventManager.OnStartSpeech_Alt += SpeechStarted;
        EventManager.OnStopSpeech_Alt += SpeechStopped;
    }

    private void OnDisable()
    {
        EventManager.OnStartSpeech_Alt -= SpeechStarted;
        EventManager.OnStopSpeech_Alt -= SpeechStopped;
    }

    private void Reset()
    {
        volume = GetComponent<Volume>();
    }

    private void Start()
    {
        volume.profile.TryGet(typeof(SCPE.SpeedLines), out _speedLines);
        _speedLines.intensity.overrideState = true;
        _speedLines.intensity.value = 0f;
    }

    void Update()
    {
        if( !_speaking || !_speedLines )
        {
            return;
        }

        _progress += (blendInSpeed * Time.fixedDeltaTime);

        //An kind of parameter that controls the visibility of an effect (eg. intensity) is always between 0 and 1
        _progress = Mathf.Clamp01(_progress);

        //Depending on the effect, the "main" parameter may be called different. Most of the time the parameter is called "intensity".
        //You can use IntelliSense to browse the available parameters (CTRL+Space after the period).
        //The .value path points to the actual value of the parameter (it may be a float, color, int, etc...)
        _speedLines.intensity.overrideState = true;
        _speedLines.intensity.value = intensityCurve.Evaluate(_progress);

        //Debug.Log($"Intensity:{_progress}");
    }
}

Comments

  • Can't think of anything on the AC side.

    Place down Debug.Log statements and check them in the Log file.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.