- Home /
Question by
BenjaminWayra · Jan 21, 2020 at 04:44 AM ·
script.unity 2dscreenshake
Adding Screen Shakes to a virtual camera in cinemachine
I need to figure out how to create a screen shake that will activate when I trigger it using the virtual camera from cinemachine.
Any ideas?
Comment
Best Answer
Answer by rufopufo · Jan 21, 2020 at 08:21 AM
Hi there,
You can read this piece of code: https://gist.github.com/ftvs/5822103
It is made to a normal Unity camera, but the only component altered is the transform. So I suppose it can work fine with Cinemachine cameras too.
Sorry, i am not very familiar with cinemachine cameras. But, as every unity gameobject has the transform component, it may work the same way.
Hope it helps.
It doesn't work because the camera is set looking at the player