Relative Content

Tag Archive for c#unity-game-engineaudioplaysound

Unity 2D Game cant play sound on Instantiated Object (Please Help)

I am currently making the 2d game Asteroids in Unity, i want to play a sound whenever an asteroid is hit by the player’s bullet however because the asteroid is an instantiated object i’ve had to use the PlayClipAtPoint Method but using this method i cannot get the sound i want to play to spawn/be audible if anyone knows a solution help would greatly appreciated

How to make a voiceline in Unity?

I am trying to make a game for my friend as a suprise and I wanted him to voice some lines for me without him knowing. I got the voicelines but ive tried numerous times to make it a voice line but it just doesnt work. How do I make it so when I get close to the GameObject (“Cube5”), a text appears saying “Press E to talk” and when I press E the voice line plays.