As the title suggested Im wondering why is building a Unity Project ends up failing due to this error(picture in the imgur link) but I can still play the scene just fine in the Unity Editor. Is there I'm missing or should I put the ACEditorPrefs inside a Editor folder along with anything that reference that class? How do I solve this issue?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The error lines don't match up with the latest release.
What's your AC version? Try importing the latest (currently v1.83.1) after taking a backup.
I'm currently using AC version v1.79.3 I can make a backup but since my team must use that old version for the game, updating AC to a new version might unintentionally break things in the game. So, I can't use that new version to build the game. Is there a work around for this?
https://imgur.com/a/l9Ucvux
Can you share the code block around the mentioned line, i.e. line 118 in Action.cs?
Sure, here's the snippet of the source code for Action.cs line 118
https://imgur.com/a/Fucb2j5
Replace line 118 with:
Thank you! The error is gone now. How does Preprocessor Directive help in eliminating the error?
It's a bit of a hack, but essentially the line references code that is inaccessible outside of the Editor. The change prevents it from being accessed in builds.
Thank you for the help. May I ask what does "return 300" do?
It causes the function to return a default value - 300 in this case, since that's the default Action width. However, since it won't ever be called in builds, the exact number doesn't really matter.