- Home /
Certain components do not update in-game until refreshed in inspector
I'm sort of new to Unity and I've been noticing a problem that comes up pretty frequently. When I want to change some part of a component, say I'm changing the runtime controller of an animator, for example. I set up a script to do this at the point in the project, and it seems to work fine, as the animator switches controller in the inspector when it should. But the problem is in the project itself.
The controller changes, I can tell that from the inspector, and the animation triggers / transitions are still happening as they normally would (pressing the attack button still damages enemies), but nothing is actually animating in the project. Not until I do something in the inspector, for example disabling and re-enabling the animator component. I've tried doing this in script, even disabling it for 1 second before re-enabling it, but it has no effect. It only updates when interacted with in the inspector.
This is a problem I've had for a while now, not just with any specific components either. It's happened so far with audio filters, animations, material shaders, etc. and it's pretty annoying. I tried building the game and seeing if it was a problem specific to the Unity Editor, but it doesn't work in the build either.
Does anyone know why this might be happening? I'd include a video but I don't think I can include video files and it would be hard to convey what is happening through pictures.
Your answer
Follow this Question
Related Questions
Unity Custom Editor Texture Warning 2 Answers
Can a GameObject inside of an array be made "accessible" from the editor? 2 Answers
Can Editor Windows function like the inspector ? 2 Answers
How To Draw a PropertyDrawer within a PropertyDrawer 0 Answers
How to change inspector with non-Monobehaviour objects ? 1 Answer