لماذا لا يلعب صوتي
-
14-11-2019 - |
سؤال
giveacodicetagpre.
من المفترض أن يلعب هذا صوتا عندما تصطدم شخصيتي بابيا، لكنه لا أستطيع أن أفهم لماذا
المحلول
Take it through simple steps; verify first with a bit of debug that your code is reaching OnControllerColliderHit, then reaching OpenDoor(hit.gameObject); Also confirm that it can play door.transform.parent.animation.Play("doorOpen"); (and make a sound in normal code rather than conditional)
From the code snippet it may be that your "playerDoor" definition is incorrect elsewhere
نصائح أخرى
Go to Project
then Book Assets Folder
then sounds folder
then drag Door_open
sound to these variables:
var doorOpenSound : AudioClip;
var doorShutSound : AudioClip;
Your sound will play.
لا تنتمي إلى StackOverflow