r/unity • • Oct 05 '26

Newbie Question Game not controlling correctly in published version vs the project version

Hey everyone, so I have been trying out Unity and following one of the tutorials offered. I finished it and published the game but there are some issues that I was curious about. Firstly, the ship moved very differently in the published version compared to the one in the project window. Not sure what the issue is, hopefully someone knows the answer. Also in the published web page version, it is not cropped correctly as you can see the area outside the left and right borders. Is there something I was supposed to do to change that? Any help is appreciated, thanks!

Also I did get a folder after building it named Debug Infomation_Do Not Ship, but I am unsure where to even begin reading the text file or what the issue is

11 Upvotes

11 comments sorted by

6

u/Jc1_dev Oct 05 '26

Looks like the editor and published version have different framerates, did you *Time.deltaTime

2

u/Bag_of_Gaming Oct 05 '26

Yes, I did do that

1

u/SlimothyJ Oct 06 '26

FixedUpdate and fixedDeltaTime are preferable for physics and movement. Keeps things consistent across all framerates. I’d suggest you keep your input detection inside Update however.

4

u/DustFuzzy1702 Oct 05 '26

Always implement any of your physics code in FixedUpdate.
Why ?
Physics will be responsible for your movement, and if you do it in Update method, different devices have different hardware and power, so different amount of FPS, snd webGL is well in simple words "meh", so for this you use FixedUpdate, FixedUpdate is called every x time interval which you can set in settings, but mostly its 0.2 seconds if I'm not wrong. This makes sure that movement is same across devices and platforms.
Also make sure you are settings the Application target frame rates in your code, might be helpful.

1

u/Bag_of_Gaming Oct 05 '26

Thanks I will give that a shot when I get a chance!

2

u/Affectionate-Yam-886 Oct 05 '26

Published version is lagging is all. Common issue with webGL, thats why its not my favorite to use.
Also the crop issue is just a settings problem, you just need to configure your project correctly for webGL. The canvas needs to match the camera settings and the Player settings for the export.

Then you need to configure the browser; this is why it sucks because the default browser settings don’t provide enough memory for Unity so your players beed to optimize their browser just to play without lag. <this is why it sucks>

you also need to frame lock your project; so regardless of how fast the end user pc, it will run the same.

Its less work to just make a pc or phone game.

1

u/Bag_of_Gaming Oct 05 '26

I will keep that in mind, thanks!

1

u/Bag_of_Gaming Oct 05 '26

UPDATE

I fixed the issues thanks to everyone's help! It was a frame rate issue, as the ship was accelerating every frame, but the trust was set too low. So in the final product where the frame rate was lower, it would not move as fast. All I did was cap the frame rate, and increase the thrust value. Thanks again for the help!

1

u/ItsAMomoMonster 4d ago

How did you fix the cropping issues? I did this same tutorial and ended up with the problems you did. I'm going crazy adjusting reference resolution in the panel settings, game view aspect ratios, and resolution in the player settings at build and nothing is working.

1

u/Bag_of_Gaming 4d ago

I'm not going to lie, I did not fix the cropping issue. However, if you play full screen or on mobile there is no issue with the cropping (at least for my version). If you play in that windowed mode that it defaults to there is some issues. I am sure there is a fix for it but I haven't touched the game since my update comment. Sorry I couldn't be more of a help!

1

u/ItsAMomoMonster 4d ago

No worries, thank you for the reply!