Search Issue Tracker
By Design
Votes
0
Found in
2020.3.41f1
2021.3.13f1
2022.1.22f1
2022.2.0b14
2023.1.0a18
Issue ID
UUM-18896
Regression
No
Documentation issue: Cube renders with an InternalErrorShader as its material will not be included when created using GameObject.CreatePrimitive
Reproduction steps:
# Open the attached project
# Open the “/Assets/Scenes/SampleScene.unity” Scene
# Build And Run the project (File > Build And Run)
# Observe the cube’s color in the Player
Expected result: The rendered cube is white
Actual result: The rendered cube is pink
Reproducible with: 2020.3.41f, 2021.3.13f1, 2022.1.22f1, 2022.2.0b15, 2023.1.0a18
Reproducible on: M1 MacOS 13.0 (22A380)
Notes:
* The Issue is reproducible on both Intel and Apple Silicon Editors on M1 Mac
* This is caused by the GameObject.CreatePrimitive method creating a renderer that references a material which is not included in the build
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
- The build size is larger when Models have Animation Type set to Generic
Resolution Note:
This is by design. What happens is that during a build Unity strips away all assets that is not referenced. This can cause problems for GameObject.CreatePrimitive if there are no other references to the material. The solution is to have an included object that refers to the material. We have updated the documentation to explain the issue as well.