Not sure if this has been asked in quite this way. I'm looking to do something hopefully a little unique.
I want when my Alien Zombie characters attack my FPS player with a bitting and clawing attack that
Bloody scratches and blood splatters will appear all over the screen and get steadily worse as my FPS players health decreases. and also to have it fade gradually as his health gets better from picking up health boxes that add to the health bar.
Also I'm wondering if there is a way to make like a heart beat sound on my FPS player that gets faster and a little louder as damage is done to him also.
Yeah I know it's a bunch to ask, but I think it would be a super cool effect perfect for the FPS game I've trying to develop all by my lil lonesome lol ;)
GUI.DrawTexture (You'd want your rect size to be `Rect(0,0,Screen.width,Screen.height`)
Textures (You'd want to put a claw texture, or perhaps several, on a plane that's using the transparent cutout shader)
The lerp function (You'd want to lerp between Color.clear and Color.white based on your health. Lerp takes a value and changes it between color one and color two based on a float between 0 and 1 that you put in, so if you have, let's say, 50 health, you'd divide that by 100 to get .50, then lerp between Color.clear and Color.white to get a 50% transparent texture. You would apply this material to the plane in front of your camera.)
Audio (You'd likely want to change the pitch and volume for the effect you're trying to achieve).
You could display a plane with transparent textures applied in front of the camera (e.g. make the plane a child of the camera) or use GUI.DrawTexture.
To fade the visibility according to health status you could use Color.Lerp or Material.Lerp.
For modifying the sound you could try to change the values for AudioSource.volume and AudioSource.pitch.
Edit:
You could also use a ParticleSystem to simulate drops of blood on your screen. Create the PS as a child of your camera, adjust the settings and texture(s) and set Simulate in Worldspace to false.
Did you manage to get the audio modification to work?
Did you manage to get the audio modification to work?
– efgeThanks but nope, I tried looking on google for a tutorial or even some kind of sample of what I was wanting to do but no such luck :(
– anon48034950