2D Freeform Lights and Camera Shake problem

Hello everyone!

I’m currently using Unity 2022.3.7f1 and have created a script that alters the variable
CinemachineBasicMultiChannelPerlin.m_AmplitudeGain of my virtual Cinemachine camera in order to create a camera-shaking effect, by Lerping the m_AmplitudeGain by a set amount of intensity and time.

However, the 2D Lights in my scene (Freeform Light type), shake along with the camera, while my 2D Light of Spot Light type does not.

Is there a way to make the Freeform light stay in place during the camera shake?

9259494--1295382--Freeform Lights.gif
9259494--1295385--Spot Lights.gif

Anyway, I found the solution. For some reason, the problem arose with the old gameObject that contained the Freeform lights and once I created new ones with the same component, the camera shake problem was resolved somehow.

EDIT: I found out that the real reason for this behavior was due to the lighting having a ridiculously high value on the z-axis (900+), and when I reset it back to zero, it started behaving as intended, aka being stationary when the camera shook.

1 Like