Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: acornbringer on July 01, 2016, 05:58:35 PM

Title: [SOLVED] Game Works in Unity but Not in Build
Post by: acornbringer 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) (https://drive.google.com/open?id=0B8EZO4USuY8-ejJrSkl5cVB6ZE0)

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

- Windows 10 64 bit
- Unity 5.3.5
- Playmaker 1.8.1
Title: Re: Game Works in Unity but Not in Build
Post by: djaydino 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.
Title: Re: Game Works in Unity but Not in Build
Post by: acornbringer 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!
Title: Re: Game Works in Unity but Not in Build
Post by: djaydino 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?
Title: Re: Game Works in Unity but Not in Build
Post by: acornbringer 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?
Title: Re: Game Works in Unity but Not in Build
Post by: Alex Chouls on July 02, 2016, 11:19:15 AM
Can you email me your test project?
Title: Re: Game Works in Unity but Not in Build
Post by: acornbringer on July 02, 2016, 03:22:08 PM
Sure thing! I sent you an email.

Thanks!
Title: Re: Game Works in Unity but Not in Build
Post by: acornbringer 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 :)
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: indeed 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
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: ericysj on September 06, 2016, 09:31:52 PM
It's not 'Solved'

Still don't work in build.

playmaker version 1.8.2!!!!



Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: Alex Chouls 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...
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: NathanParable 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.
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: Alex Chouls on September 06, 2016, 11:12:33 PM
Can you PM me a link to download a repro project?
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: NathanParable 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.
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: rubiez64 on October 20, 2016, 07:25:26 AM
any news on the subject?

any workaround?

it still causes problems...

after build, nothing's working
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: acornbringer on November 29, 2016, 05:33:00 PM
I don't get emails when people reply to my posts for some reason so I lost track of this post.

Just to reiterate, when I build the game while it is running, this solves my problem.

I see there are others having similar issues with gui and perhaps other things so I can't speak for those circumstances but running the game right before building works for MOUSE DOWN events and colliders.
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: jeanfabre on December 01, 2016, 02:50:26 AM
Hi,

 ok, very odd indeed. Are these object prefab instances?

Bye,

 Jean
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: acornbringer on December 01, 2016, 10:29:14 AM
They are Unity primitive shapes with SFMs on them that detect the MOUSE DOWN event but the mesh renderer has been turned off. They are not prefab instances, just scene objects. I haven't tried an updated version of Playmaker yet so I can't say if this is changed with new releases of either Unity or Playmaker.

I'm working in Unity 5.3.6 and still using Playmaker 1.8.1. Running the game before building has been working out just fine though.
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: jeanfabre on December 14, 2016, 02:07:26 AM
Hi,

 Can you make another post, this one was solved, it was a setup of the scene that made it work only in editor.

 Bye,

 Jean
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: Panskliros on March 02, 2017, 09:33:41 AM
I have the exact same issue. Any fix?
Title: Re: [SOLVED] Game Works in Unity but Not in Build
Post by: jeanfabre on March 06, 2017, 12:58:55 AM
Hi,

It's likely a problem of logic inside your Fsms, and not a  PlayMaker Bug.

 Make a simple scene with a cube, and test a single feature, the mouse down for example, if that works, then you'll need to compare this with your other scene and setup. I know, it's a pain, but we all have to go through this... You could do some logs as well in the state you think you are reaching or not reaching to make sure of where you are when built.

Bye,

 Jean