Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  obi rope breaks after build.
#2
(27-09-2023, 09:22 AM)Alexander34 Wrote: Hi again, I have the following problem.

I have some logic that changes the length of a rope. Everything works fine, however after I make a build in IL2CPP or BuildIn, both in build and in Unity happens what is shown in the video. I have tried a lot of things, but I can't solve it.
Code
Video

Hi,

The code executed is the same in both builds and editor, so there should be no difference in behavior. I'd suggest checking the player log for errors that might be affecting execution, specially NullRefExceptions as it's common for references to assets/resources to be missing in the build but not in the editor.

Also, be mindful of the order in which MonoBehavior methods like Awake(), Start(), etc are called since it's undefined, and may change between the editor and builds. A common source of problems is expecting a specific call order, things may work in the editor but as soon as you build the app the update order changes and things stop working. See: https://docs.unity3d.com/Manual/ExecutionOrder.html

Quote:In general, you should not rely on the order in which the same event function is invoked for different GameObjects — except when the order is explicitly documented or settable. (If you need a more fine-grained control of the player loop, you can use the PlayerLoop API.)

You cannot specify the order in which an event function is called for different instances of the same MonoBehaviour subclass. For example, the Update function of one MonoBehaviour might be called before or after the Update function for the same MonoBehaviour on another GameObject — including its own parent or child GameObjects.

kind regards,
Reply


Messages In This Thread
obi rope breaks after build. - by Alexander34 - 27-09-2023, 09:22 AM
RE: obi rope breaks after build. - by josemendez - 27-09-2023, 02:01 PM
RE: obi rope breaks after build. - by Alexander34 - 27-09-2023, 02:26 PM
RE: obi rope breaks after build. - by Alexander34 - 27-09-2023, 03:42 PM
RE: obi rope breaks after build. - by josemendez - 27-09-2023, 05:56 PM
RE: obi rope breaks after build. - by Alexander34 - 28-09-2023, 11:09 AM