Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.47f1
2022.3.56f1
6000.0.35f1
6000.1.0b3
6000.2.0a1
6000.3.0a1
6000.4.0a1
Issue ID
UUM-93284
Regression
No
A script cannot be attached to a GameObject when there is another script that is generic with the same name in a different folder
Steps to reproduce:
1. Open the attached “ClassNameBug.zip” project
2. Open the “SampleScene”
3. In the “Assets/0param” folder find “MyScript.cs”
4. Attach the script to a GameObject within the Project Hierarchy
5. Observe the results
Expected result: The “MyScript.cs” file is added as a Component
Actual result: An error message is shown
Reproducible in: 2021.3.47f1, 2022.3.56f1, 6000.0.35f1, 6000.1.0b3
Reproducible on: Windows 11, Windows 10
Not reproducible on: No other environment tested
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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note:
The case is very specific with several unlikely circumstances and there is a lot of ways to avoid it. Here are a few:
* Put scripts in different assemblies (Just creating AssemblyDefinition file next to one of the scripts works)
* Put scripts in different namespaces
* Use different class names (if a generic class is inheriting a MonoBehaviour you might use suffix "Base" as it is likely to get inherited by class that you'll actually use on GameObject)