Answer the question
In order to leave comments, you need to log in
How to change the movement sound depending on the surface in Unity?
I am working on a project in Unity. I have all the necessary sounds for moving on grass, asphalt, etc., but I don't understand how to make the character change the movement sound if he moves from grass to sand, for example.
Answer the question
In order to leave comments, you need to log in
Add the character to the OnTriggerEnter(Collider col) event, where it will be:
switch (col.gameObject.tag)
{
case "Sand":
GetComponent<AudioSource>.audioClip = sandStepAudio;
case "Ground:
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question