Learn to code by making a 2D space shooter game.

both these need to run inside late update.
global variable
Mathf.MoveTowards Moves a value current towards target.
set initial rotation value according to your need I have set the value of the rotation multiplier to 0.15.
solve the above problem by assigning the value to the inspector.
Note: rotation to get notices depends on the magnitude you pass when you call the camera shake method if you put zero it won’t affect rotation that much since zero time rotation multiplier the rotation will be zero point.
we multiply by shakefadetime multiply rotation multiplier so shake rotation to decrease according to the value of magnitude we pass when we call CameraShaker method.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store