HOW TO PLAY A SOUND ON KEYPRESS IN UNITY WITH C# TUTORIAL

  Рет қаралды 12,362

Jimmy Vegas

Jimmy Vegas

Күн бұрын

In this Mini Unity Tutorial we learn how to play a sound effect by pressing a key on the keyboard.
✦ Subscribe: bit.ly/JimmyVegasUnityTutorials
✦ Patreon: / jimmyvegas
✦ FREE Assets: jvunity.com/
✦ Facebook: / jimmyvegas3d
✦ Twitter: / jimmyvegas17
-----------------------------------
✦ Start your game development career today in Unity 2017 - Unity 2018.1 and even Unity 2020 and learn how to make a game through the power of Unity. Every Unity Tutorial at JV Unity costs NOTHING from you, and any support received through KZfaq, Patreon or Facebook is greatly appreciated.
-----------------------------------
-----------------
Who Is Jimmy Vegas?
-----------------
Jimmy Vegas is one of the top KZfaq tutorial developers. In depth Unity Tutorials teaching you how to make a game in unity 3d! My unity tutorials include development, programming in C#, coding logic and more. For beginners, it's easy how to learn unity with tips and tricks you can make a game for FREE. I provide FREE assets for you to use and learn.
Start your game development career today, for free. #UnityTutorial #UnityTutorialForBeginners #JIMMYVEGAS

Пікірлер: 28
@danielreeves4181
@danielreeves4181 2 жыл бұрын
I never leave comments, but this tutorial was exceptional. Thank you very much!!!!!
@blissofkundalini
@blissofkundalini 3 жыл бұрын
Works perfectly! Thank you!
@madbitscience6230
@madbitscience6230 3 жыл бұрын
I like how you use game objects for each audio clip to simplify it and organize it.
@ArjunSingh-wc2jf
@ArjunSingh-wc2jf 3 жыл бұрын
this helped me a lot im gonna subscribe thank you!
@hatdogngnanaymo2893
@hatdogngnanaymo2893 3 жыл бұрын
That helped so muchhh Thank youuuuuuuuuuu
@tbraun6289
@tbraun6289 3 жыл бұрын
This is great, thank you! I have a longer clip and am wondering if there's some way to pause the sound by hitting a different key?
@olsbol9253
@olsbol9253 4 жыл бұрын
Thx for this
@hatdogngnanaymo2893
@hatdogngnanaymo2893 3 жыл бұрын
This is so helpful bro, imma subscribe
@PolskiDev
@PolskiDev 4 жыл бұрын
ok so i need help when i try to loop only when i HOLD the key but it keeps playing when i stand still HELP
@epical1736
@epical1736 3 жыл бұрын
I know it's probably too late but you can do something with stopping the sound when the key is released.
@zbob8991
@zbob8991 2 жыл бұрын
@@epical1736 how do you do that, 9 months later I have the same question lol
@dannydelgado3095
@dannydelgado3095 3 жыл бұрын
Do you know how to not have multiple sounds play when pressing the same key?
@SunchippStudio
@SunchippStudio 4 ай бұрын
i don't have input options in the project settings..actually there's no options at all. all I want to do is add a car horn but NO BODY has what I am looking for...who would've thought that something so simple ISN'T online
@SandraCoyle
@SandraCoyle 3 жыл бұрын
Thanks for the video, i have a question, how do I do it with the Arrows keys? :)
@JimmyVegasUnity
@JimmyVegasUnity 3 жыл бұрын
you can use Input.GetKeyDown(KeyCode.UpArrow)) - just replace Up with either Left, Right or Down depending on what key you want to use
@SandraCoyle
@SandraCoyle 3 жыл бұрын
@@JimmyVegasUnity Hey Jimmy, i have done that, but the w,a,s,d are working, but not the 4 arrows keys ? :)
@SandraCoyle
@SandraCoyle 3 жыл бұрын
I made it, thank you so much, there was just a spelling error :P
@skeletonbuilder3484
@skeletonbuilder3484 10 ай бұрын
how i can make the sounds start Serially
@chesteeer
@chesteeer 2 жыл бұрын
how can i change the key to be F and not 1?
@Alexander-ij5vz
@Alexander-ij5vz 4 жыл бұрын
how can I play a sound on an object with a mouse click? I think that was with local.position or anything. Also if the object change the position, it would worth, too.
@cyberninja3087
@cyberninja3087 4 жыл бұрын
you could do like if(Input.GetMouseButtonDown(0)){ Sound.Play() }
@Alexander-ij5vz
@Alexander-ij5vz 4 жыл бұрын
@@cyberninja3087 thank you mate
@sir_southpaw5456
@sir_southpaw5456 3 жыл бұрын
i tried doing this for a rolling SFX, every ti,e i press Left Shift it crashes the game. i have the Audio Source and Listener under my main camera. could it be something in my script? I'm nor getting any error in the console using System.Collections; using System.Collections.Generic; using UnityEngine; public class RollSFX : MonoBehaviour { public AudioSource[] soundFX; void Update() { if (Input.GetButtonDown("Roll")) soundFX[0].Play(); } }
@nightyysleeps
@nightyysleeps 3 жыл бұрын
is ur sound very big?
@nightyysleeps
@nightyysleeps 3 жыл бұрын
just keeps looping
@JimmyVegasUnity
@JimmyVegasUnity 3 жыл бұрын
Untick the loop tickbox on the component
@frogmasto
@frogmasto 2 жыл бұрын
i'm not the only one that read SFX wrong right? :p
@breakabletuber5058
@breakabletuber5058 4 жыл бұрын
3th, pin msg pls.
HOW TO MAKE A SIMPLE FLASHLIGHT MECHANIC WITH C# IN UNITY TUTORIAL
12:26
1. Sound Effects and Music in Unity: Item Collection
5:56
Night Run Studio
Рет қаралды 1,9 М.
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 10 МЛН
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 58 МЛН
Can A Seed Grow In Your Nose? 🤔
00:33
Zack D. Films
Рет қаралды 24 МЛН
20 Advanced Coding Tips For Big Unity Projects
22:23
Tesseract
Рет қаралды 171 М.
HOW TO PLAY ANIMATION IN KEY PRESS WITH C# UNITY TUTORIAL
6:58
Jimmy Vegas
Рет қаралды 117 М.
Unity Interaction Tutorial :  3D Sound (Change Volume by Distance)
3:35
SoomeenHahm Design
Рет қаралды 8 М.
HOW TO GENERATE A RANDOM OBJECT ON KEY PRESS IN C# UNITY TUTORIAL
9:57
Programming portals for my DOOM-style FPS
17:15
jdh
Рет қаралды 206 М.
The Real Reason Robots Shouldn’t Look Like Humans
1:27:20
Veritasium
Рет қаралды 1,2 МЛН
Unity - Play A Sound Effect With Button Click (2022) | EASY Unity Tutorial
5:18
xxRafael Productions - Rafael Vicuna
Рет қаралды 36 М.
Creating a Mute Button in Unity
7:13
Unity Mechanics
Рет қаралды 8 М.
HOW TO USE POST PROCESSING IN UNITY 2020 TUTORIAL
31:23
Jimmy Vegas
Рет қаралды 73 М.
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 10 МЛН