One Minute Wwise | Play a sound from a key in Unity

How to play a sound from a key on your keyboard in Unity.
No commercials, no lengthy introductions - get "Wwiser" in less than 1 minute!

To play a sound in Unity, when you press a key on your keyboard, you need to:
1. Open your Unity Project.
2. Make a new script with a Wwise-Type property.
3. Create a bit of logic that detects when you press a key on your keyboard.
4. And select the event in the Inspector.
So let's begin. Open your Unity project, and make sure the Wwise project is connected. Go to the Hierarchy and choose where the sound should play from, and add a new PlaySound script on that game object. In the PlaySound class, you write 'public Ak.Wwise.Event', and name it 'SomeSound'. Next, detect when you press a key on your keyboard. So in the Update() function, which runs every frame, write if a key is pressed down, and that key is the spacebar, then post the sound on this game object. Now save the script, select an Event in the PlaySound script and press Play. Now press the spacebar. That's it!

Resources:
* The script with more details: https://github.com/MadsMaretty/OneMinuteWwise/blob/master/Play%20a%20sound%20from%20a%20key%20in%20Unity/PlaySound.cs
* About Wwise Types: https://hubs.ly/H0rFxXj0
* About Unity scripts: https://docs.unity3d.com/Manual/CreatingAndUsingScripts.html
* About If Statements: https://learn.unity.com/tutorial/if-statements
* Creating a Wwise-Type property: https://hubs.ly/H0rFypc0
* About Input.GetButtonDown(): https://docs.unity3d.com/ScriptReference/Input.GetButtonDown.html
* About "public" and other Access Modifiers: https://learn.unity.com/tutorial/scope-and-access-modifiers#5c8a40e9edbc2a001f47ccef
* Video about posting with Wwise Types: https://www.youtube.com/watch?v=8AWRNeIL0U4
* How to connect Unity to your Wwise project: https://www.youtube.com/watch?v=Oin2x0px1kM
* How to post a sound using a component: https://www.youtube.com/watch?v=2XSMtKFbVVY&list=PLXMeprTk4ORPo5PNwc8Wr9F-mgE-qBPUC&index=1

5800 视图

相关视频

04:42

Wwise 301 L2-03 | AkAmbient's MultiPosition Mode

11:00

SoundSeed Grain - Product Overview

03:27

Wwise 301 L2-01 | Posting with AkAmbient

相关视频

04:42

Wwise 301 L2-03 | AkAmbient's MultiPosition Mode

4850 视图
11:00

SoundSeed Grain - Product Overview

3514 视图

Wwise Tour

每年的巡讲会活动在不同城市举行,届时游戏开发行业的人士(特别是游戏音频专业人员)将齐聚一堂,相互学习和分享最优秀的游戏音频团队的创意成果和专业技能。

邀请我参加下一次 Wwise 巡讲会!