Search Issue Tracker
Script Import Settings ignored when component added from another script
- Create a script, e.g. TestScript, with public field of type GameObject.
- Open "Script Import Settings" and set some prefab to this property.
- Create another, which will add a component TestScript (gameObject.AddComponent<TestScript>();) and attach it to a game object in the hierarchy
- Hit play
Actual: The component is created, the public field is null;
Expected: Public field is initialized with prefab, that was set in Script Import Settings. The behaviour is the same when attaching TestScipt component manually, by dragging over a game object.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- An error message is displayed when any type of file is saved outside the project's assets folder
- [iOS] 'Automatically add capabilites' doesn't work
- [UI Toolkit][Android] Text field becomes multiline during edition in the Player when the Multiline option is disabled in the UI document TexField settings
- BadImageFormatException is being thrown after creating URP or HDRP Template Projects
- Custom fonts aren’t applied to TextMeshPro Text when using <font> tag