简体   繁体   中英

Unity works fine in editor but the scripts aren't starting in build

I've made my first unity project and everything works fine in the editor. There are multiple c# scripts, and they all worked. However, when I made a Windows build, the scripts didn't start and only the objects were shown. The game just stands there, and you need to close it with Task Manager. Does anyone know the solution?

It happens a lot to me and I still don't know what causes that. There are some cases where rebuilding the project helps, so try rebuilding the project

I found the solution! I tried to run it with the Update method, and this had many more frames in the editor than in the build. However, I found the FixedUpdate Method that always runs the same frames. With that, I found out I needed much more Force added to the object.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM