Hi guys,
I’ve been trying to add camera shake when an enemy hits me but I can’t figure out how to override the Virtual Camera controls. I avoid triggering this with animation states and I would prefer to do this by purely script so I can call it in other situations.
Thanks!
I found a solution to this one. It was pretty easy. I simply did the following:
- Add a Cinemachine Collision Impulse Source script to my Player.
- Use 6D Shake for the Raw Signal.
- Fiddled around with Amplitude Gain and Frequency Gain.
- Under Trigger Object Filter -> Layer Mask and checked all the Layers I want to trigger the camera shake.
- Add a Cinemachine Impulse Listener to my State Driven Camera.
- Checked 2D Distance.
See: Cinemachine - Impulse
1 Like