Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2019.4.1f1
2020.2
Issue ID
1273157
Regression
No
Targets array error with no line number or class name when selecting an asset
Reproduction steps:
1. Open attached project "TargetErrors.zip" and scene "BugScene"
2. In Package Manage, import attached packages "Package1" and "Package2" from disk
3. In Hierarchy window, 'New Sprite (1)' -> 'Sockets' -> 'Socket' GameObject
4. With Inspector window open, observe Console window
Expected result: No error, or error with line number and class name
Actual result: "The targets array should not be used inside OnSceneGUI or OnPreviewGUI <...>" error with missing line number and class name
Reproducible with: 2019.4.21f1, 2020.2.7f1, 2021.1.0b9, 2021.2.0a7
Not reproducible with:
Could not test with: 2018.4.27f1 (console errors break project)
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
- The Scrollbar becomes unusable when adding Elements to the List
- "One or more data file missing for baking set NewScene Baking Set. Cannot load shared data." error in Player when a specific project is built
- Choosing new HDR Colour using RGB values breaks colour on Intensity Selectors
- Rendering/Decal Layer Mask options are different inside Prefab Mode and outside Prefab Mode when the project is upgraded to Unity 6
- Incorrect Realtime GI Light Probes baking when more than one Light Probe Group is used and "Baked Global Illumination" is enabled
Resolution Note:
As mentioned in the error user project is using target inside OnSceneGUI Method if we remove that the code which uses target these errors are gone.