Built project missing textures and models, looks perfect in Editor and in play mode.

Hi all,

I have been bashing my head against the wall on this one for some weeks now, I have a game built with Unity 2022.3.7, I recently upgraded my pv as was that time and although I find it difficult to blame that process I really don’t have any idea of why it happened, allow me to explain and show some images.

So this is what the game looks like played in Unity Editor:

And here is what the build produces:

I have a log file in player prefs but all it tells me is textures failed to upload, there is no indication to what textures or why, I can only assume the missing textures are for example missing on the building in the second image.

The things I have tried:

Deleting Library Folder - I did this but it always finishes with Unity being white and I have to force close and re-open Unity, this normally works for restarting by there is no difference in the build results.

I have tried to use Deep profilling and bundle profiller in the application but it never seems to work for me the game just tends to not start.

If anyone has experienced this or knows anything about it or how to resolve I would be greatly appreciated :smile:

Many thanks all and I hope you all have a great day.

Charlie

You are aware that this is an alpha version? And an early one at that.

If you want to actually create and publish a game, stick to the LTS or tech stream releases. Beta and particularly Alpha versions are for experimentation, testing, prototyping only - and of course bug reporting if you run into issues.

Yeah, because you DO NOT LEAVE UNITY OPEN when deleting the Library folder! Sorry, but that should be self-understood. You cannot expect a program to behave nicely when you pull the rug under its feet (eg essentially deleting files the editor is currently working with).

First thing you do now is to close the project (if open), then delete your project’s Library folder, as it may contain corrupt data. Then try open it again. If the issue persists, try to reproduce it in a new project and if it also happens there, report it as a bug.

If on the other hand you actually care to make progress with your project, install Unity 2022.3 or 2023.1. Then delete the Library folder of your project. Also make a backup of your project (you don’t need to backup the Library folder). Then try to open it with these official Unity versions, fix any possible errors due to incompatible package versions or API, and then try building again.

First off, I mistakenly put 2023, I meant 2022.3.7 secondly don’t assume I left Unity open when deleting the Library folder how dare you be so rude. I am actually quite disturbed by the manner in which you addressed this post

I very much closed unity, deleted folder and relaunched, after unity imported all packages it went white.

Rereading your post, I am very disappointed in the fact you immediately think you know what I have or haven’t done or what I do or do not care about, shame really, I was hoping for actual help and not rudeness

I’m really sorry! :frowning: I’ve understood this sentence “it [deleting Library] always finishes with Unity being white and I have to force close and re-open Unity” that you did so with the project still open in the editor.

Also I take things as they are, like the Unity version. :wink:

Did you check the build report? It’s in the editor.log after a build. Since you mention bundles you may want to check that you also built the necessary bundles and that they’re available and being loaded in the build. I haven’t used them much, I think you do need to actually load a bundle in code if you use assets in asset bundles - it may work in the editor because it contains the asset either way.

The “white screen/icons” issue has been reported several times. Sometimes updating graphics driver helps but if you search specifically for that you’ll find threads with more things to try but apparently not one specific solution.

Updating to patch 11 might also help, it’s a minor step but you never know.

Hi, understood, I have done all of the above, I have even tried several different versions of 2022.3 from .7 onwards, but after deleting the library, I even restart my system to make sure nothing is lingering, but the project launches fine and starts importing assets, then when I presume it finishes it and any editor windows are just white no gui.

The build report shows the usual failed shaders but they have no impact on the build as have always been there, and the build completes as it normally would do.

I feel like something is breaking the asset import but finding this specific cause is difficult, the build plays like normal to a point but half the visual elements are missing or dark and pixelated, the player prefs log just reports “Texture upload failed” and no other trace or error.

This is why I am now reaching out as I have tried every standard practice when dealing with project errors and corruptions.

Thanks, and sorry for biting this issue has been causing me many sleepless nights, and I understand that is no excuse so I apologise for how I retaliated.

All the best.

Hi

Create a folder named Resources and put what items, textures etc are missing there and see if helps.

https://docs.unity.cn/520/Documentation/Manual/LoadingResourcesatRuntime.html#:~:text=Resource%20Folders%20are%20collections%20of,name%20the%20folder%20“Resources”.

None of those drive images work.

Use the built-in image attach function of the forum.

It has the important advantage that it works and stays with your message for future reference.

When you report this all I can do is guess:

I guess two possible things:

  1. editor lighting is defective unless you bake it

OR

  1. you’re getting tofu fonts.

I am very hesitant to respond to someone who is this incredibly sensitive, but I want to be helpful so perhaps you should look at these two areas:

Keep in mind this is an engineering support forum, nothing more.

lighting in editor:

Editor has a bug with lighting if you auto-bake. Turn off auto-bake and bake your lights.

https://answers.unity.com/questions/1264278/unity-5-directional-light-problem-please-help.html

The current first scene will look correct, but when as you load or reload a scene, that subsequent scene will be darkish.

tofu fonts and / or blank buttons:

I read recently this can be fixed by specifying OpenGLCore in the preferences, as follows:

https://discussions.unity.com/t/898354/8

https://discussions.unity.com/t/898931

If it isn’t one of those two things, then it is…

Time to start debugging! Here is how you can begin your exciting new debugging adventures:

You must find a way to get the information you need in order to reason about what the problem is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.

What is often happening in these cases is one of the following:

  • the code you think is executing is not actually executing at all
  • the code is executing far EARLIER or LATER than you think
  • the code is executing far LESS OFTEN than you think
  • the code is executing far MORE OFTEN than you think
  • the code is executing on another GameObject than you think it is
  • you’re getting an error or warning and you haven’t noticed it in the console window

To help gain more insight into your problem, I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.

Doing this should help you answer these types of questions:

  • is this code even running? which parts are running? how often does it run? what order does it run in?
  • what are the names of the GameObjects or Components involved?
  • what are the values of the variables involved? Are they initialized? Are the values reasonable?
  • are you meeting ALL the requirements to receive callbacks such as triggers / colliders (review the documentation)

Knowing this information will help you reason about the behavior you are seeing.

You can also supply a second argument to Debug.Log() and when you click the message, it will highlight the object in scene, such as Debug.Log("Problem!",this);

If your problem would benefit from in-scene or in-game visualization, Debug.DrawRay() or Debug.DrawLine() can help you visualize things like rays (used in raycasting) or distances.

You can also call Debug.Break() to pause the Editor when certain interesting pieces of code run, and then study the scene manually, looking for all the parts, where they are, what scripts are on them, etc.

You can also call GameObject.CreatePrimitive() to emplace debug-marker-ish objects in the scene at runtime.

You could also just display various important quantities in UI Text elements to watch them change as you play the game.

Visit Google for how to see console output from builds. If you are running a mobile device you can also view the console output. Google for how on your particular mobile target, such as this answer for iOS: https://discussions.unity.com/t/700551 or this answer for Android: https://discussions.unity.com/t/699654

If you are working in VR, it might be useful to make your on onscreen log output, or integrate one from the asset store, so you can see what is happening as you operate your software.

Another useful approach is to temporarily strip out everything besides what is necessary to prove your issue. This can simplify and isolate compounding effects of other items in your scene or prefab.

If your problem is with OnCollision-type functions, print the name of what is passed in!

Here’s an example of putting in a laser-focused Debug.Log() and how that can save you a TON of time wallowing around speculating what might be going wrong:

https://discussions.unity.com/t/839300/3

“When in doubt, print it out!™” - Kurt Dekker (and many others)

Note: the print() function is an alias for Debug.Log() provided by the MonoBehaviour class.

When you find out more…

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, log output, variable values, and especially any errors you see
  • links to documentation you used to cross-check your work (CRITICAL!!!)

The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven’t put effort into finding the documentation, why should we bother putting effort into replying?

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

  • Do not TALK about code without posting it.
  • Do NOT post unformatted code.
  • Do NOT retype code. Use copy/paste properly using code tags.
  • Do NOT post screenshots of code.
  • Do NOT post photographs of code.
  • ONLY post the relevant code, and then refer to it in your discussion.

Firstly, thanks for responses, the forums image embed doesn’t work with Google Drive images and I don’t have a provider to use in this instance.

It’s not a lighting issue or a fonts issue, all “general” to do’s have been done as I explained in my first post.

The difference is from Unity Play Mode to Build
this is the game playing via Unity Editor in play mode


and this is the built project, the build shows no gui, no 3d object textures for the building and the vehicle looks just black.

There is no difference in scenes, the build should display what Unity shows.

Hi, I’m going to try this shortly, I’ll let you know if it makes any difference.

Note also that sometimes need to declare the shaders in a list of to include shaders in Unity settings, if adding in Resources does not do it.

Another thing to consider is what Quality is set for the build in Quality settings, note that the editor quality might be set differently, that is a usual reason that makes things look different, but should generally not make things dissapear.

Also what pipeline is used ? If using URP make sure also the forward renderer is set to Forward and not Deferred, this is another reason shaders may not appear, if are custom and not Deferred compatible, or not set to UniversalForwardOnly tag.

For clarification the build worked perfect, then I upgraded my pc and from that moment on the project wouldn’t build properly, so before the system upgrade the build and Unity both worked.

So it’s nothing to do with shader includes as these were all fine pre-upgrade

as for rendering it is URP and again it was perfectly fine before I built a new pc.

It looks like a shader issue tbh, since some items appear and some dont.

I would try two things, copy the building and use a new material with a URP standard shader on it and see if appears, also apply the building material on the terrain and see if dissapears. Then will for sure be the shader used for example.

Note that shaders get rebuilt in new machine, so at that point could be anything. Working on the previous could well stop if the shader is recompiled with different settings for example.

Would this affect GUI as well? as half the GUI is missing or incomplete

From experience this looks like shader stuff too. Usually shaders not being included into the build for whatever reason.

I would try adding these shaders to your Always Include Shaders in graphics settings. If addressables is in play, I have in the past needed to ensure that an object using a material that uses the shader was included in a scene that was being built into my addressables groups.

thanks all

Hey, have you found a solution to this?