Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Strange differences between editor and build
#1
Hi again, I'm having some odd differences between my game in editor and when I build it (Standalone pc x86 windows build)

In the editor things run as I expect and would like, but in the build they don't, for example my track laying system allows left clicks to build the spline, the last CP is on the mouse cursor and if you right click it deletes this and ends the track at the previous CP (essentially cutting off the un-committed last segment of the track) which is what I want.

However when I build it and do exactly the same thing, right clicking does seem to remove the CP (I am outputting the number of CPs in a text box to try and debug in the build and the number goes down) but it then must be moving the previous CP to the end of the spline even though I have not committed it to that point, as the track now ends at the mouse cursor rather than the previous CP like it does in the editor.

I have another issue but I feel like fixing the above might fix that so I won't detail that issue as well.

Whilst doing this debugging I also noticed the transform.name of the CP's in editor is CP0001, CP0002 etc but in the build they are as below image instead? I have no idea if this is related or not but thought it was odd.

Are there things I should be aware of when it comes to making a build? I haven't touched script execution order or anything like that, do you have any thoughts that I could investigate this further?

Names of CP transforms in editor:

[Image: editor.jpg]

Names in build:

[Image: error1.jpg]
Reply
#2
Hi,
Is your spline building logic access the CPs via their name? In that case, the difference of naming between the editor and the build would explain your issue. Still in that case, you should access CPs via their index (spline.ControlPointsList[index]) and not via their name.
When running in the editor, Curvy Splines does some operations related only to the editor, like handling undoing. Such operations are skipped when the game is running in a build. This is done by putting them in a code section compiled only when in the editor, by using #if UNITY_EDITOR
Part of those operations is to rename the cps nicely (CP0001, CP0002, ...)
Did this helped you fix the issue?
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Splines Built In Editor Undo causes issues. Lupos 1 9 10-02-2023, 08:52 AM
Last Post: _Aka_
  Invisible generated meshes in build itsGama 5 10 06-08-2023, 11:53 AM
Last Post: _Aka_
  Can Curve Spline be used for an in game level editor. Lupos 30 71 06-03-2023, 10:58 AM
Last Post: _Aka_
Brick Extending Curvy to make a Hallway editor. JacobSL 5 396 02-13-2023, 09:29 AM
Last Post: _Aka_

Forum Jump: