Slow down time + postprocessing

Ok so i had a script for slowing down time and physics when space is held but i tried to add post processing effects (specifically chromatic aberration) when it does that and Unity was like “Nope! Wrong answer!” and now the entire thing doesn’t work

Here’s my awkward shambling together of scripting stuff i know I tried to do this with ::

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

public class slowDownPhysics : MonoBehaviour
{
    //Are you happy now Unity console?
    private float fixedDeltaTime;

    //Sort out Post Processing 
    PostProcessVolume m_Volume;
    ChromaticAberration m_ChromaticAberration;

    void Awake()
    {
       //Appease the C# Gods
        this.fixedDeltaTime = Time.fixedDeltaTime;
        m_ChromaticAberration.intensity.value = 0;
    }

    void Update()
    {
        //Detect if space pressed
        if (Input.GetButton("Jump"))
        {
            if (Time.timeScale == 1.0f)
            {
                //Slow down time + Post Processing
                Time.timeScale = 0.15f;
                m_ChromaticAberration.intensity.value = 1;
            }
            //Make it so Unity doesn't fuck it up
            Time.fixedDeltaTime = this.fixedDeltaTime * Time.timeScale;
        }
        else
        {
            //Keep time normal
            Time.timeScale = 1.0f;
            m_ChromaticAberration.intensity.value = 0;
        }
    }
}

Please help.

What does this mean?

It’s very colorful and almost demands that I sketch up a caricature of Unity sternly wagging its finger at OP with a smoldering pile of file folders in the background labelled “project.” Does that help you narrow it down @StarManta ?

2 Likes

When I hold space it doesn’t do anything

That’s not how you use the post stack, (n?)or the forums…

            var ca = post.chromaticAberration.settings;
            ca.intensity = newValue;
            post.chromaticAberration.settings = ca;

Besides maybe throwing one error per frame?

In the process of rewriting the script, did you maybe un-assign your Jump Button?