Hi,
I was about to release a new version for my 3D HDRP game but the editor kept generating a weird build.
On the past versions (the ones released yesterday) and on the editor, everything looks fine just like on this video (the main menu).
However, the new build for Windows seems broken, and has weird black effects everywhere. Here is a video to show you.
I tried generating a new build but the same happened. I tried playing it on two different PCs and nothing changed.
Between the versions I only modified a tiny bit a script that isn’t even in the main menu (affected scene along with the others). I didn’t modify anything otherwise.
I also tried to update my graphics pilotes but it didn’t help.
What could cause this?
Thanks!
EDIT: The issue persists but some builds seem to work, while others don’t. I’m assuming it’s a bug?
First thing is to check if the logs are complaining about anything.
Next thing might be right-click reimport all
Hi,
Thanks for your reply!
I rebuilt the game for Windows but there wasn’t any error in the logs. It just returns:
Build completed with a result of ‘Succeeded’ in 209 seconds
On the other hand, would reimporting all have any impact on the project? I have never used this option and afraid it may break stuff.
EDIT: When switching to Linux and building the game, a few issues are prompted, but I’m not sure if these are related. I use Standards Assets in my project.
(Warning)
You are trying to create a MonoBehaviour using the ‘new’ keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all
UnityEngine.MonoBehaviour:.ctor ()
UnityStandardAssets.CrossPlatformInput.MobileControlRig:.ctor ()
UnityEditor.Build.BuildPipelineInterfaces:InitializeBuildCallbacks (UnityEditor.Build.BuildPipelineInterfaces/BuildCallbacks)
(Removeable Error)
NullReferenceException
UnityStandardAssets.CrossPlatformInput.MobileControlRig.EnableControlRig (System.Boolean enabled) (at Assets/External/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs:89)
Those errors need to be fixed. Either one could cause any number of other problems.
If they’re in the Standard Asset code then something is wrong with it and you’ll need to upgrade or fix it, or else find out how / why it is crashing, perhaps because some part of it is misconfigured (eg, missing some field).
Any error or warning can cause any amount of code not to run, causing any other code relying on it to fail in mysterious ways.
I just fixed the script issues. This allowed me to create a good build for Linux, but when switching to Windows, another warning popped twice, that I didn’t see before. I believe this is what’s causing the issue now, as the next build on Windows was broken. I use HDRP for my game.
Shader warning in ‘HDRP/Lit’: ‘USE_FPTL_LIGHTLIST’: macro redefinition. Previous definition found at :1. at line 874
I tried to look this warning up but didn’t find much regarding my build issue.
I’ve never really handled shaders so whatever ChatGPT is returning seems to also be ineffective.
I tried to move the project to another computer and build it from here but it didn’t help.
I also attempted to disable/enable some options such as GPU Skinning but yet again nothing worked.
Any ideas?