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.

171338-bike-effects.png

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?

171340-missing-script.png

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.

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.