In 5.5 I had a working plugin that used sendmessage to send text from an overlaid html form to my game. In 5.6 this plugin doesn’t work and pops up an error saying SendMessage is undefined so … where did it go?
I’m also concerned that this breaking change will stop 3rd party sites like Kongregate and Armor Games from working with Unity.
You have to specify which instance of the game you want to send a message to. ie gameInstance.SendMessage()
This is needed because you can now have more than one WebGL instance embedded in a page, so it needs to know which one to send it to.
Thanks for the heads-up … just tested this and it does indeed break the Kongregate API (which relies on using SendMessage to do things like IAP, leaderboards, getting the player name etc.)
I’ll be emailing them now about this, really pretty annoyed that this made it live.
edit - they’re aware of the issue and should have a fix live next week.
It’s not really the fault of Kongregate or Unity, it’s pretty normal for some leadtime between a new release and 3rd party asset catchup. The usual way forward is to wait until 3rd party tools have caught up or pain your way through the issues.
Jumping on the latest Unity release and not expecting some 3rd party tools to be incompatible is a going to end badly often.
This is 100% the fault of the Unity WebGL team. Kongregate (afaik, could be Facebook by now) is the largest platform for Unity WebGL games.
Unity made multiple breaking changes that it didn’t even mention in the release notes and didn’t bother to update the documentation for.
If they’d listed these in the release notes I wouldn’t have upgraded. If they’d fixed up the documentation I wouldn’t have had to waste hours working things out myself. If they’d notified the platforms using Unity WebGL content then they could have made the trivial changes needed ahead of time. These things would have taken a Unity employee minutes to do, by not doing them they waste many days of developer time, their customers time.
I truly appreciate the massive amount of work that goes into all the new features and so on but releasing multiple breaking changes without telling anyone about them, without bothering to update documentation is simply not acceptable in a paid product. Grr
Sorry but it doesn’t work like that - you are responsible to ensure a new version does’t break your project before “upgrading”. Unity even warns you about this every time you upgrade - it’s a serious warning for a reason.
Do you use version management? Simply revert and go back to the previous version. If you don’t use version management and didn’t commit before you upgraded then how is that anyone else’s fault?
Kongregate is a third party, it’s not Unity’s responsibility to manage how every change will effect all third party tools (regardless of how big their platform is). That’s Kongregate’s job, and they need the time to address changes. The risks of jumping on a new version of a game engine is a well understood concept and not something you just do because it’s been released (as tempting at that is).
You need to be realistic and you need to take the correct precautions when upgrading - it’s part of being a developer.
I get that you’re annoyed, but really it should be a 5 minute job to revert back to your previous commit and use the previous version of Unity until Kongregate is fixed to work with the latest version. Blaming Unity or Kongregate is misguided.
As mentioned in another post, we are sorry docs were not updated in time for release.
Having said that, the Beta phase is an opportunity for plugins providers to test their plugins still work correctly with an upcoming release. IIRC, the new embedding system has been in 5.6 for the entire Beta phase.
Apple and Google and Microsoft are also 3rd parties … imagine the uproar if Unity released a new version that had undocumented breaking changes that required these companies to change their code before Unity could work on their platforms.
Imagine if you updated Excel and suddenly you couldn’t open documents with macros in them. Or you updated your phone OS and now it won’t open your email app.
Reverting IS a 5 minute job but working out that I needed to revert took hours of my time because all of this was undocumented.
The only source of information for these changes appears to be a blog post from 6 months ago.
I appreciate the apology for not updating docs but we’re simply too accepting of this sort of behavior as devs - just because we’re capable of working out solutions doesn’t mean we should have to. A normal release management process would have saved the Unity WebGL developers many days (weeks?) of man hours.
The already released content you broke was Unity itself. It went from an app capable of making a build and publishing it to … not being capable of this. The breaking changes mean Unity 5.6, for devs making Kongregate games, is non functional now until Kongregate catch up (they tell me this will be next week).
The customers / users of Unity aren’t the games players, they’re the devs using it to make games.
It’s good to hear that this isn’t ‘good enough’ and really hope you make concrete changes to stop this happening in future. Thanks!
while I understand workarounds are (hopefully) temporary you can assign the sendmessage to a different function in js e.g.
window.SendMessage = gameInstance.SendMessage
I am using this in our current project until a 3rd party api has released its update.
Could you be more specific about the workaround? Tried upgrading to Unity 5.6 today and lost a whole day on getting the Kongregate API to work with no success. Basically calls to functions like the one shown below are now generating ‘isGuest is not defined’ error messages in the javascript console, and I think it’s related to this SendMessage problem.
Application.ExternalEval(@"
// Extern the JS Kongregate API
function isGuest()
{
return kongregate.services.isGuest();
}