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
- Visual Studio debugger doesn't show full properties of animation variables on Android and IOS Platforms when using IL2CPP Scripting Backend
- [Linux][Plastic SCM] "Access Denied" error when downloading Plastic SCM Cloud Edition through the Editor
- UpdateRendererBonudingVolumes process takes more time when disabled Renderers are used
- "ArgumentNullException: Value cannot be null" error is thrown when selecting a Visual Element with a custom Render Texture set as a background
- Changes are not saved when changing Styles' orders in the UI Builder
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.