Unity3d camera jitter effect, direct control using scripts, of course, you can also choose to use the Dotween plug-in, but not to use only one function, the import of a plug-in;
Script Example:
usingUnityengine;usingSystem.Collections; Public classCamerashake:monobehaviour { PublicTransform Cameratransform; PrivateVector3 _currentposition;//record the position before dithering Private float_SHAKECD =0.002f;//Frequency of Jitter Private int_shakecount =-1;//Set jitter Count Private float_shaketime; voidStart () {if(Cameratransform = =NULL) Cameratransform =transform; _currentposition= Cameratransform.position;//record the position before dithering_shakecount = Random.range ( -, -);//Set jitter Count } voidUpdate () {if(_shaketime + _SHAKECD < time.time && _shakecount >0) {_shakecount--; floatRadio = Random.range (-0.01f,0.01f); if(_shakecount = =1)//Jitter is set to the position of the record before the last moveRadio =0; _shaketime=Time.time; Cameratransform.position= _currentposition + Vector3.one *Radio; } }}
Unity3d camera Jitter Effect Camerashake