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

Assets Management

-

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

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.