Question by
Warl0ck · Dec 17, 2016 at 09:21 PM ·
script.smoothperlin noise
Fade in and Fade Out Camera Shaking Effect Over Time
Hello Guys... I am Having Trouble for Making Fade In and Fade Out Effect For For Camer Shaking
As we know perline noise start from random value between 1,-1 and then gives us smooth and random graph which is very good for camera shaking
but my problem is wehn i press button it starts the shaking camera for 5 seconds and then when i press button again it just takes random number then it goes shaking again smooth...
what i want to do is make fade effect so that camera start shake from last position when and keep shaking smoothly
this is basic scrip i am using using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour {
public float heightScale = 1.0F;
public float xScale = 1.0F;
void Update() {
float height = heightScale * Mathf.PerlinNoise(Time.time * xScale, 0.0F);
Vector3 pos = transform.position;
pos.y = height;
transform.position = pos;
}
}
Comment