Search Issue Tracker
Fixed in 5.0.X
Votes
0
Found in
5.0.0b18
Issue ID
661239
Regression
Yes
[Prefab] gameObject.GetComponents(list) does not get components on prefab
Steps to reproduce this issue:
1. Open the attached project
2. It has 'test' prefab
3. Prefab has 2 scripts: 1) MainScript 2) SubScript
4. MainScript uses: 1) this.GetComponents(list1); and 2) gameObject.GetComponents(list2) to get and add 'SubScript' components to lists
5. On Prefab toggle the checkbox "toggle me to validate"
6. Watch the log as it counts number of list elements:
this.GetComponents(list) 1 / gameObject.GetComponents(list) 0
7. Drag 'test' prefab into the scene
8. Toggle the same checkbox
9. Now log indicates:
this.GetComponents(list) 1 / gameObject.GetComponents(list) 1
Works fine in 4.6
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Add comment