My game does work in Unity,does not after build and run!

I did everything as the video tutorial,but after i build and run it through my desktop,it runs but i cant interact.I cant press quit or start button.Please help.

1 Like

Hi Sortiris,

When you say build and run, do you mean via the File menu, e.g.

image

Assuming so, what platform did you specify? Web?


I think that will show you.
I work on Windows 10,and my Unity version is 4.6.something.

Hi,

Ok, great, a Windows stand alone build. So, in your list of scenes, what exactly is Game2? What is different in that scene than in the one called Game?

Also, on your Start scene, can you take a screenshot with one of the buttons (Quit / Start) selected, and show me the details from the Inspector please - specifically the OnClick event section.

The difference is that i have different text buttons in game2 than game.


Both screenshots attached.As i told you everything works perfect in the Engine,i can interact with everything but when i build it and run it from my desktop,its working but its not interactive,like the texts are not buttons!
Thank you.

1 Like

Hi,

Just so I am clear, are you saying the buttons don’t do anything, or, is it just that they don’t change colour when you hover over them?

Both of them.In unity when the cursor is on them they change colour and when i press them they load another level.When i build it and run it through my desktop,game runs fine but its not interactive.When my cursor is on the text,the text doesnt change colour and when i press click they dont change level.I think i helped you :slight_smile: .

Thank you

1 Like

Ok, thanks.

Can you zip up the project and make it available here, I will take a look for you.

If the project is less than 10mb you can upload it to your reply, alternatively, you could use Google Drive, One Drive or Dropbox etc and provide the URL.

NotInteracts_Data.zip (7.9 MB)

Sure.Here it is!

Hi,

Sorry, that’s the built application, I meant can you zip up the project for me, so that I can open it in Unity / debug etc…

NotInteracts_Data.zip (7.9 MB)

Sorry about that.Maybe you need this,check and inform me please!
Thank you.

Erm, nope - that’s the same download… :slight_smile:

I need the project files. There will be an assets folder, a library folder, a project settings folder etc…

image

oh i didnt notice that,my mistake sorry!
Project.zip (122.5 KB)

Hehe, no worries. :slight_smile:

I should have chance to take a look again in a couple of hours.

So Rob did you find the bug?

Hi,

Sorry, I lost sight of this, my apologies. :pensive:

I have flagged the topic and will take a look first thing in the morning, again, my apologies.

No worries Rob :smiley:

Well, usually when there is a bug within a build it shows in the console Just after you finish building it.
Don’t seems to be the problem here, but what oftenly causes problems with Builds outside the editor and that don’t seems to cause those same problems within the editor runtime is the execution order, make sure that you don’t have anything being addressed within the same event that other script is trying to reference it. It’s worth to take a look at the start method in the scripts involved at this button press

1 Like

Hi @Sotiris_Avgeris,

Ok, so I’ve tested the project at this end and, after building, it’s working perfectly as a Windows build, the issue you have described is not present.

So, this begs the question - why not.

One of the differences I am going to assume is that the version of Unity I have opened and built your game with differs to that of yours. I don’t currently have any version 4.x.x installations of Unity on my laptop, the oldest I had installed was version 5.4.1.

Let me know which version of Unity you are using and I will download/install and run the same test to see if I can reproduce the issue.

I do recall UI issues in one of the older versions, in fact, I believe Ben mentions this at one point in one of the lectures when the mouse over the button fails to change the colour of the text.

I am available for the next few hours, so whenever you have a moment.


Updated Fri Sep 29 2017 09:50

Just had a quick look through your first uploaded zip file to see if I could ascertain the version number from that, in doing so I ran the game again and discovered this;

As you can see from the video, the interaction is there, it just isn’t “on” the actual button, it’s off to the left.

If you can give me the Unity version you are using I will then take a look at the project in that, as I don’t want to rely on the Unity 5.4.1 version as there will be many changes.


Updated Fri Sep 29 2017 09:54

If you set “Windowed” mode when you run your game;

image

You should find the issue goes away. If I had to guess at this point I should suggest that when the game isn’t running “Windowed”, the display is obviously stretched full screen and in your build, this then allows the boundary boxes for the buttons to be moved, remaining relative to their initial positions.

This behaviour doesn’t occur in version 5.4.1. By default, even with a full screen display, the buttons work as expected. This could be a bug in an old Unity version, or it could just be that we need to take a few extra steps to defend against this behaviour.

Hope all of the above is of use.

Okay rob,Yeah i windowed the screen and its playing perfectly.Also when its full screen its seems that the button is somewhere else.My version is 4.6.9f1 but no need to do something.Seems that version is old and i use windows 10.Thank you so much.I will close the question!

1 Like

Privacy & Terms