Hello, I just finished the Wwise tutorial on the website and am trying to practice setting up footsteps with Unity. However I am having trouble to make the surface switches work.
I'm using the John Lemon game as practice project, and I'm trying to set up footstep switches to respond to the different surfaces he is walking on (wood, carpet, etc.).
What I've done so far:
1. Added a PostWwiseEvent script to the player character John Lemon.
public class PostWwiseEvent : MonoBehaviour
{
public AK.Wwise.Event MyEvent;
// Start is called before the first frame update
public void PlayFootstepSound()
{
MyEvent.Post(gameObject);
}
// Update is called once per frame
void Update()
{
}
}
2. Attached events and assigned PlayFootstepSound() to John Lemon's walking animation.
3. Added colliders to the carpets/rugs on the map, added components to each of them: 2 AkSwitch (Trigger on Enter and Exit), Ak Trigger Enter, and Ak Trigger Exit.
--Is Trigger is checked; Switch is set to my surface switches in Wwise; Trigger Object is set to John Lemon.
However, when I test play, only the default footstep (wood) sound would play. I connected to the profiler and saw only 2 entries related to switch at the beginning:
Timestamp Type Description Object Name Game Object Name Object ID Game Object ID Scope
0:00:14.229 Switch Switch to "Carpet" Surface JohnLemon 1834394558 18030 Game Object
0:00:15.189 Switch Switch to "Wood" Surface JohnLemon 1834394558 18030 Game Object
I think I'm missing something to tell Unity to get the switch value, but I don't know how to do that.
Could someone help me? I've been looking all over for this, and tried to follow some tutorial videos but none has worked so far.
Thank you very much.