Shader not changing according to scene light in real time.

So I have a custom unlit shader that is affected by the ambient light in the scene and it works perfectly fine. However, one problem that I have is that it doesn’t seem to update in real time. If I change the colour of the skybox, the standard URP shader will instantly react to it, but for my custom shader, I have to go into the shadergraph to do a slight change to update it (not doing anything, just expanding the window is enough to refresh it). So I was wondering if there is any way I can make it instantly refresh eveytime the ambiental light is changed. I am currently using this custom script to take the ambiental light information.

void GetAmbientalInformation_half(out float3 SkyColor, out float3 EquatorColor, out float3 GroundColor)
            SkyColor = (1, 1, 1, 1);
            EquatorColor = (1, 1, 1, 1);
            GroundColor = (1, 1, 1, 1);
            SkyColor = unity_AmbientSky;
            GroundColor = unity_AmbientGround;
            EquatorColor = unity_AmbientEquator;

Thank you in advance.

Nevermind, apparently there is a node for ambiental lighting.