playMaker

Author Topic: Audio on a prefab  (Read 2026 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Audio on a prefab
« on: July 14, 2014, 04:15:15 PM »
Hi!
I have a prefab bullet which shooting on another prefab. Everything is working fine, except the audio. I just discovered that I can't have an audio source on a prefab. It just say "You can't play a disabled audio", so how can I solve this? Is it a way to play an audio clip when to prefabs collides?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

xhidnoda

  • Full Member
  • ***
  • Posts: 231
Re: Audio on a prefab
« Reply #1 on: July 14, 2014, 05:39:44 PM »
maybe you can save like game object your audio... (?)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Audio on a prefab
« Reply #2 on: July 14, 2014, 05:40:50 PM »
I think it was because i had destroy self on the same state as the audio. Then it couldn't play the audio. Strange, because it works with objects in the scene.

I hate to work with prefabs I need to destroy, because you can't just destroy a prefab. You need to fine another way. It's always some problems. Wish they could do it more easy.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Audio on a prefab
« Reply #3 on: July 14, 2014, 05:42:31 PM »
Hi, xhidnoda!

What do you mean?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

xhidnoda

  • Full Member
  • ***
  • Posts: 231
Re: Audio on a prefab
« Reply #4 on: July 14, 2014, 05:48:02 PM »
i not sure, but, you can Create Game Object (audio) and when you try to play audio you just call the variable...sorry for my english.