Quantcast
Channel: Latest Questions by GraviterX
Viewing all articles
Browse latest Browse all 122

Changing Footstep Sounds On Different Surfaces

$
0
0
Hey guys. So I just made up this simple script that is going to tell when the player is walking on different floors to be able to change the footstep noise. However, I'm not entirely sure how to change the variables. So attached to my player is the standard First Person Head Bob script that came with the standard assets. I'm trying to get it so that this script will tell what surface the player is on by using a tag or something, and then changing the variables of the First Person Head Bob script to some preset audio clips. This is the script I have so far: var player : GameObject; var woodSound : AudioClip; var metalSound : AudioClip; var script : FirstPersonHeadBob; function Start() { script = player.GetComponent(); } function OnTriggerEnter(other : Collider) { if(other.gameObject.tag=="Wood") { script.FootStepSounds = woodSound; } } I'm not sure if I'm doing it right. Any help or advice on this?

Viewing all articles
Browse latest Browse all 122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>