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
  Gizmos not showing in the editor 2019.3.1 & 3.6 athos_k 5 457 06-15-2020, 01:25 PM
Last Post: _Aka_
Brick Strange thing happening when setting RelativePosition curvyuser007 1 223 05-17-2020, 09:34 PM
Last Post: _Aka_
  CurvySpline Editor event ATHellboy 1 512 03-08-2020, 01:51 PM
Last Post: _Aka_
  Lots of Allocs in Editor Update (Poor Performance in Editor) TdayMFG 4 1,054 02-06-2020, 10:13 PM
Last Post: _Aka_

Forum Jump: