Script not included in build
I have created a simple script that adds some effects to my player. It works fine in the editor, but when I build the game the scripted behaviour is not occuring as it does in the editor.
I've looked at the properties of the script, comparing it to one attached to the same game object which is included in the build and I cannot find any differences.
I also looked at the Assembly-CSharp.csproj file and saw that the missing script is not listed.
Opening both scripts in Visual Studio I can see that the one that is included is listed under the Assembly-CSharp project where as the missing script is listed as Miscellaneous files. Is this related? I created both scripts simply by adding them in the Unity Editor. Why might one be attached to one project and the other not?
I'm a little out of my depth here and I've searched around and not found an answer. Any help would be much appreciated.
I get no errors when
Cheers.
Answer by glasshalfpool · Nov 21, 2020 at 02:56 PM
Hi guys
This turned out to be a complete red herring. The actual cause of the problem was that not related to the script being missed in the build at all, but was instead caused by me not realizing that while you can see emission changes in the editor at runtime without the emission box being ticked, when you build, the emission behaviors will not appear in game if the box is not ticked.
Cheers.
Your answer
Follow this Question
Related Questions
Unity 5.4 crash after iOS version building and open xcode8 0 Answers
[HELP] Build size is way big! 0 Answers
SteamVR_LaserPointer Color changes from Unity Editor to Game Build 1 Answer
Why Is Daydream Build and Run Not Working? 0 Answers
Cannot check "Unity C# Projects" when trying to build. 3 Answers