The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help How to stop music playing?
Chap Offline
Member

Posts: 99
Threads: 16
Joined: Jul 2012
Reputation: 2
#1
How to stop music playing?

Hey,

I'm having a problem with my script to play music. I have six levels and in the first one, there's a script that starts music. When entering the second level, there is a script to stop music.

The code is as follows:
void OnEnter(){     PlayMusic("02_amb_strange.ogg",true ,0.4f,0.2f,1,false);}


On the next level, I have a statement that should stop the music from playing which is as follows:
void OnEnter(){    StopMusic(2.0f,0);}


However, there is a problem. When I enter the second level, the music continues to play. On the last 3 levels, the music is supposed to stop but it doesn't on any of them. I've tried putting StopMusic statements in 'OnLeave' in addition and that doesn't work.

Is there something I'm missing?

[Image: 20643.png]
07-12-2012, 03:59 PM
Find


Messages In This Thread
How to stop music playing? - by Chap - 07-12-2012, 03:59 PM
RE: How to stop music playing? - by SilentStriker - 07-12-2012, 04:05 PM
RE: How to stop music playing? - by Chap - 07-12-2012, 04:25 PM
RE: How to stop music playing? - by SilentStriker - 07-12-2012, 08:27 PM



Users browsing this thread: 1 Guest(s)