Unity 3D Play Audio Sound OnTriggerEnter
Making free platform game ! One man show
----------------------------------------
Javascrip: GOOD 4 2D GAMES AND 3D GAMES !
----------------------------------------
var soundFile:AudioClip;
function OnTriggerEnter(trigger:Collider) { if(trigger.collider.tag=="Player&qu
}
---------------------------------------------------------------
Dear members here is alternatives !
All Java Scripts name it how you like !
------------------------------------------------------------------------------------
First Java script is for looping music after trigger enter :
------------------------------------------------------------------------------------
All Java Scripts name it how you like !
------------------------------------------------------------------------------------
First Java script is for looping music after trigger enter :
------------------------------------------------------------------------------------
var Sound :AudioClip;
function OnTriggerEnter() {
audio.clip = Sound;
audio.Play();
}
function OnTriggerExit(){
audio.Stop();
}
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
Second Java script is for sounds to fire only once:
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
private var hasPlayed : boolean = false;
var Sound : AudioClip;
function OnTriggerEnter() {
if(!hasPlayed){
audio.clip = Sound;
audio.Play();
hasPlayed = true;
}
}
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
Third Java script is for trigger sounds (fire every time you enter a trigger):
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
var Sound : AudioClip;
function OnTriggerEnter() {
audio.clip = Sound;
audio.Play();
}
made with ezvid, free download at http://ezvid.com
TriggerEnter 2 is also my favorite sound player. thanks for the post.
ReplyDeletehttps://www.youtube.com/watch?v=vgWmA2Qn8zc
Thanks for sharing that information with us really informative.. Keep posting and I'm waiting for your
ReplyDeleteupcoming response..Thanks
code xbox live gold
I'm trying to find some good music to relax and meditat too. I don't usually listen to it so i'm not framiliar with it but i need some songs that are like sound effects kind of like, Rain, the ocean, the rainforrestt, etc. I also enjoy that like indian? Buddha? music. Like Shakra or something like that. Or just like piano music, something that will bring me to another place when i close my eyes, like the middle of a field full of flowers. Thank you.
ReplyDeleteKevin Mongelli Music
NIce article this article has been my favorite, interesting and informative article.
ReplyDeleteMobile
Amazing and interesting photos. really love games and all information.
ReplyDeleteoverwatch
Interesting blog about the games and i really love and like your blog keep it up.
ReplyDeletecatan board game
Great article, this is such an interesting and informative article.
ReplyDeleteThe Walking Dead
What are some good websites to play free online games?
ReplyDeletefree online games to play
Hey we just launched a Gaming Platform games online free where you can play over thousand games for free, earn POINTS to get on the leaderboard and also add games as a developer or player to the platform.
ReplyDelete