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
- SystemInfo.get_graphicsDeviceName() is generating garbage GC Alloc when using Metal graphics API
- Crash on D3D12CommonShader::ApplyGpuProgram when attaching material which samples "_UnityFBInput0" to "Full Screen Pass Renderer Feature" Component
- SpeedTree meshes and objects count differs when comparing the numbers in the Player with the Editor
- Model and Prefab Preview icons are not updated after upgrading associated Materials to URP
- Game view is rendered white when viewing the Editor with HDR display and Post Proccesing is enabled on the Main Camera with 2D URP
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.