playMaker

Author Topic: [SOLVED] Game Works in Unity but Not in Build  (Read 18355 times)

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
[SOLVED] Game Works in Unity but Not in Build
« on: July 01, 2016, 05:58:35 PM »
Hey there!

When I build my game, my edit button doesn't seem to work. The scrolling and double click work just fine but when I click the pencil icon, nothing happens at all. Everything is controlled with FSMs.

I posted a screenshot of the scene while the game is running after having pressed the button. You can see just where it is in the scene and in the hierarchy. I also have a build of the game so you can maybe see what's happening in there. This is my first Playmaker game so I really can't imagine what could be wrong with it.

The button is a simple cube with a box collider where I attached a MOUSE DOWN event to.

Download the game build from my Google Drive HERE (45MB)

I'd really appreciate some help! Thanks alot :)

- Windows 10 64 bit
- Unity 5.3.5
- Playmaker 1.8.1
« Last Edit: July 12, 2016, 10:15:08 AM by acornbringer »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Game Works in Unity but Not in Build
« Reply #1 on: July 01, 2016, 06:33:32 PM »
Hi,
Try adding a state between the 2 mouse downs and add the "next frame event" action in it.
In both ways.

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
Re: Game Works in Unity but Not in Build
« Reply #2 on: July 01, 2016, 09:58:21 PM »
Is this what you meant?

This way, the button still doesn't send the event in the build version. It does work that way in Unity however.

Funny enough, double clicking the background works just fine in the build version despite also using a similar box collider and mouse down event. I have other buttons in the game as well but they don't work in the build either.

Hopefuly this narrows it down a bit. I'll keep messing around with it but suggestions are very comforting!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Game Works in Unity but Not in Build
« Reply #3 on: July 02, 2016, 04:00:38 AM »
Hi,
You should not add mouse down event to the next frame events, you should use a different event name for it :)
But it seems that it is not the problem so you can remove them.

When i started to repo your issue i got the same issue.
But then i removed the "Mesh Renderer Component" instead of disabling and then it worked.

Then i wanted to repo it again in the same scene (putting back the Mesh componment also made a new cube) but i could not get the problem anymore,
So it seems there is a bug there, but i think it might be a bug in unity

can you try on your side if this worked and let us know if it worked?

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
Re: Game Works in Unity but Not in Build
« Reply #4 on: July 02, 2016, 09:30:25 AM »
Thanks for your perseverance! I tried what you suggested and replaced the mesh renderer component with a new one but I'm still getting the same results. I also tried removing the mesh render component outright but that didn't do it either.

For good measure I have also tried building the game without running in case unity is doing silly things. I tried this normally, after replacing the mesh renderer and after deleting the mesh renderer but I still get no results.

I'm trying to compare the button that doesn't work to the background FSM object that does work. The only difference I can tell is the background has "is trigger" set but changing that on the button didn't seem to work. Ive also removed the object from it's parent and set it further towards worldspace z=0 in case it's a camera clipping problem or it's placement in the hierarchy is what is causing the problem but no dice.

Another experiment I just tried was creating a new cube and copying the FSM onto it. When that didn't work, I tried making an all new FSM with the mouse down event and that didn't work either. Then I gave a new cube a mouse over event instead and still got nothing :-\

Now I'm testing in another project also in Unity 5.3.5 but using playmaker 1.7.8.4 instead. The mouse down event worked fine in the build. Then I updated the project to 1.8.1.f10, recreated the SFM, built the game and the event no longer works. So that's a result. Maybe It's something in this latest version that is causing problems. What do you think?
« Last Edit: July 02, 2016, 09:33:10 AM by acornbringer »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Game Works in Unity but Not in Build
« Reply #5 on: July 02, 2016, 11:19:15 AM »
Can you email me your test project?

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
Re: Game Works in Unity but Not in Build
« Reply #6 on: July 02, 2016, 03:22:08 PM »
Sure thing! I sent you an email.

Thanks!

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
Re: Game Works in Unity but Not in Build
« Reply #7 on: July 12, 2016, 10:14:20 AM »
I had my email setting unchecked by mistake so I haven't been able to correspond with Alex however I did find a fix for my problem that is kind of interesting to me:

If I run my project and build while it is running, everything works fine! So that's good :P

I'd like to find some other way around this but for now I'll mark this topic as solved.

Thanks everyone :)

indeed

  • Junior Playmaker
  • **
  • Posts: 85
Re: [SOLVED] Game Works in Unity but Not in Build
« Reply #8 on: July 14, 2016, 06:14:35 PM »
Hi I'm having a similar issue. Events triggered by a mouse click do not work in the build, but they work if I run the build while in Play mode.

- OS X 10.11.2
- Unity 5.3.5
- Playmaker 1.8.1

ericysj

  • Playmaker Newbie
  • *
  • Posts: 1
Re: [SOLVED] Game Works in Unity but Not in Build
« Reply #9 on: September 06, 2016, 09:31:52 PM »
It's not 'Solved'

Still don't work in build.

playmaker version 1.8.2!!!!




Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: [SOLVED] Game Works in Unity but Not in Build
« Reply #10 on: September 06, 2016, 10:05:20 PM »
Can you share (privately) a project that reproduces the issue? We have not been able to reproduce the problem here...

NathanParable

  • Playmaker Newbie
  • *
  • Posts: 6
Re: [SOLVED] Game Works in Unity but Not in Build
« Reply #11 on: September 06, 2016, 11:09:49 PM »
I seem to be having a similar issue. I have a ugui button you can click to switch between six camera angles (using Set Camera). It works fine in the editor, but refuses to work when built; the button just does nothing.

I'm on Windows 10, and i'm using the latest versions of both Unity 5 and Playmaker.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: [SOLVED] Game Works in Unity but Not in Build
« Reply #12 on: September 06, 2016, 11:12:33 PM »
Can you PM me a link to download a repro project?

NathanParable

  • Playmaker Newbie
  • *
  • Posts: 6
Re: [SOLVED] Game Works in Unity but Not in Build
« Reply #13 on: September 07, 2016, 03:41:03 PM »
I've just sent you a PM.

EDIT: Whoops! Nevermind, I just solved my issue. Turns out I had my extra cameras tagged as "Editor Only", which of course means they'll only work in the editor.
« Last Edit: September 07, 2016, 04:54:29 PM by NathanParable »

rubiez64

  • Playmaker Newbie
  • *
  • Posts: 1
Re: [SOLVED] Game Works in Unity but Not in Build
« Reply #14 on: October 20, 2016, 07:25:26 AM »
any news on the subject?

any workaround?

it still causes problems...

after build, nothing's working