playMaker

Author Topic: [SOLVED] - Sendmessage error - [SOLVED]  (Read 1026 times)

Martin-Vaupell

  • Junior Playmaker
  • **
  • Posts: 69
  • Creating CarbonDiOxide
    • View Profile
    • Evisystems
[SOLVED] - Sendmessage error - [SOLVED]
« on: May 01, 2014, 03: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



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?
« Last Edit: May 02, 2014, 07:05:33 AM by Martin-Vaupell »

Martin-Vaupell

  • Junior Playmaker
  • **
  • Posts: 69
  • Creating CarbonDiOxide
    • View Profile
    • Evisystems
Re: Sendmessage error -
« Reply #1 on: May 02, 2014, 07: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);