TileVania - How Do You Handle Camera Shake With Cinemachine?

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:

  1. Add a Cinemachine Collision Impulse Source script to my Player.
  2. Use 6D Shake for the Raw Signal.
  3. Fiddled around with Amplitude Gain and Frequency Gain.
  4. Under Trigger Object Filter -> Layer Mask and checked all the Layers I want to trigger the camera shake.
  5. Add a Cinemachine Impulse Listener to my State Driven Camera.
  6. Checked 2D Distance.

See: Cinemachine - Impulse

1 Like

Privacy & Terms