- Home /
(Editor) How to delete duplicate components from GameObject that persists when the scene reloads
When I've been opening and closing my scene with various connections put together, I have a script that both retains information but also loads information. Currently I have a bug where I have multiple instances of the script on multiple objects. I have an editor script that finds them all and destroyimmediately(this, true) from an editor script. It works until you save exist and restart the application.
I've even tried doing research and using PrefabUtility.ApplyRemovedComponent but getting errors.
So I only have one way that works and that is to manually remove the component.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to add a component on a GameObject in Custom Inspector 1 Answer
Editor DestroyImmediate Remove component via script 4 Answers