Hello dear community!
I’m new to Unity and I’m going to do a Slender Kit.
But now I’m stuck at the static noise effect.
It’s hard to explain how it works, but I’ll try…
I am using NoiseEffect.cs from Image Effects.
The starting value of the noise effect should be 0.
When the player’s health (100) decreases, the noise effect’s value should increase.
The maximal value of the noise effect can be 5.
I tried to do a script, but this script just decreases the noise effect, which starts with the value 5, when the player’s health decreases.
I just paste the script:
var HealthScript : PlayerHealth;
var NoiseScript : NoiseEffect;
var NoiseMultiplier : float = 20.0f;
function Update () {
NoiseScript.grainIntensityMin = HealthScript.health / NoiseMultiplier;
NoiseScript.grainIntensityMax = HealthScript.health / NoiseMultiplier;
}
Can anyone help me?
- Regards, starscratcher
PS: Sorry if anything’s spelled wrong, my English isn’t that good.
Thanks, now everything works! I also did this for the sound fading-in.
– starscratcher