Since I installed the postprocessing stack v2 and applied it to my game, my game suddenly and out of nowhere throws me a NullReferenceException regarding my stamina bar (which has nothing to do with the post processing, I didn’t change a single thing about this script), even though it worked perfectly fine before…?
This is the error it throws me:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Rendering.PostProcessing.RuntimeUtilities.get_copyStdMaterial () (at Library/PackageCache/com.unity.postprocessing@2.2.2/PostProcessing/Runtime/Utils/RuntimeUtilities.cs:269)
UnityEngine.Rendering.PostProcessing.PostProcessLayer.BuildCommandBuffers () (at Library/PackageCache/com.unity.postprocessing@2.2.2/PostProcessing/Runtime/PostProcessLayer.cs:605)
UnityEngine.Rendering.PostProcessing.PostProcessLayer.OnPreCull () (at Library/PackageCache/com.unity.postprocessing@2.2.2/PostProcessing/Runtime/PostProcessLayer.cs:440)
It looks like individual lines of code in the Extension are broken…?
funnily enough, the game runs in the preview, but it still throws the errors…
Plz help im going insane ![]()
Thank you!
edit: I tried removing the main camera and the post processing volume game object, which then led to the random stamina bar bug showing up.
NullReferenceException: Object reference not set to an instance of an object
PlayerMovement.FixedUpdate () (at Assets/Scripts/PlayerMovement.cs:64)
here’s the code:
staminaBar.fillAmount = (stamina / maxStamina);
stamina and maxStamina are both floats declared to 3f, and the staminaBar Image is declared and referenced to the script…
wth ![]()