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
- Standard Unity Materials and Shaders become corrupted after importing specific Asset Packages
- [Linux][OpenGL][Vulkan] Draw calls are not shown in the Event List when taking a capture of a frame with RenderDoc
- Inaccurate collision detections when Rigidbody Collision Detection is set to "Continuous" or "Continuous Dynamic"
- Crash on Object::IncrementPersistentDirtyIndex when upgrading project version
- [iOS] Multiple Xcode project instances created before opens up when performing Build and Run for iOS Platform
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.