playMaker

Author Topic: Audio Clip changed but no sound  (Read 817 times)

SawyerK

  • Junior Playmaker
  • **
  • Posts: 93
Audio Clip changed but no sound
« on: May 27, 2021, 09:16:35 AM »
I try to change an audio clip runtime, which works flawlessly, but cant hear the new sound of the audio clip. It seem like that it doesn't start to play the new audio clip.
I've run out of ideas how to fix it.
It gets the audio of the Gameobject. it works:

It sets the audio of the gameobject after putting the engine in the car. it works:

Its the original audio. Can hear the sound.

Its the changed audio. Can't hear the sound.

If i set the rus310_on audio to be the original sound of the gameobject it works, so it's not the audio file's fault.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Audio Clip changed but no sound
« Reply #1 on: May 28, 2021, 07:45:53 AM »
Hi.
If you change the clip you need to 'Play' it.

Instead of placing the audio files you could use audio play and target the audio objects.

If you still need to place clips use 'Set Audio Clips'.
Try to minimize using Get/Set Properties actions.
Since there are 'mirroring' and therefore slower, also to build on some platforms you need to use Linker Wizard and play through the whole game to make things work correctly.

SawyerK

  • Junior Playmaker
  • **
  • Posts: 93
Re: Audio Clip changed but no sound
« Reply #2 on: May 29, 2021, 03:33:51 PM »
Thank you for the help!

The Set Audio Clip and Audio Play works flawless.
Sadly I use a lot of get/set properties because I the UnityCar asset so i cant really change that.
Do i need to use Linker Wizard if i only port the game to PC?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Audio Clip changed but no sound
« Reply #3 on: May 29, 2021, 04:26:45 PM »
Hi.
Best is to try with a build.