Oke i am beginner and i need help about shake screen .Shake screen is important for my game cos it is horror and witch is chasing you and i need that shake.I managed to make 1 script that is shake on a button but i wana change that to witch trigger or cube trigger on anything trigger here is my script pls some1 help me
static var shakeInt = 50.0;
var decrease = 5.0;
var magnitude = 5.0;
function Update () {
if (shakeInt < 0){
shakeInt = 0;
}
if (shakeInt != 0){
shakeInt -= 1decreaseshakeIntTime.deltaTime;
}
var cam = camera.main.transform;
if (shakeInt > 0){
cam.rotation.x += Random.Range(-magnitudeshakeInt, magnitudeshakeInt);
cam.rotation.y += Random.Range(-magnitudeshakeInt, magnitudeshakeInt);
cam.rotation.z += Random.Range(-magnitudeshakeInt, magnitude*shakeInt);
if (Input.GetKeyDown(“q”)){
shake.shakeInt = 20.0;
}
}
}