Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Martin-Vaupell on May 01, 2014, 06:06:18 AM

Title: [SOLVED] - Sendmessage error - [SOLVED]
Post by: Martin-Vaupell on May 01, 2014, 06:06:18 AM
I'm having trouble sending a message triggered by a player.

Situation

Player enters a trigger, triggers in Playmaker -> Send message -> EndLevel

as seen here

http://i.imgur.com/6mILudi.png
 (http://i.imgur.com/6mILudi.png)


Run the level It's fine while in Unity, however,
when I do an actual build and test, it does not work at all and i get the debug error..

http://i.imgur.com/HuQj0Pp.png


The message is recived by the script here

Code: [Select]
#region EndGame
void EndGame()
{
// Play sound
audio.PlayOneShot (endLevel);

// Grab and set the starRating
SetScore();

// Mark level complete and unlock next level
MarkLevelCompleted();

// Save money
saveStats();
// Save stats
savePlayer();

// next level
// MadLevelManager.MadLevel.LoadNext();
// go to select
MadLevelManager.MadLevel.LoadLevelByName("LevelSelect");
}
#endregion
Not sure, how and why

Any ideas?
Title: Re: Sendmessage error -
Post by: Martin-Vaupell on May 02, 2014, 10:05:02 AM

SOLVED!!!

The error was caused by an empty play sound gameObject, in the script.

Code: [Select]
// Play end level sound
audio.PlayOneShot (endLevel);

So by commenting it out, the error went bye bye ;)


Code: [Select]
// Play end level sound
// audio.PlayOneShot (endLevel);