I have a script on an object that is enabled only when interacting with a specific object (in this case, the lock component for a door, which is only enabled once the key is picked up), but the script’s OnMouseOver function is throwing errors when the player looks at it, despite the component being disabled.
I have tried numerous things to prevent this but have gotten nowhere.
I am using the standard setup, using void OnMouseOver(), nothing else is calling it and I have no fancy code behind anything else that is using it, is there an alternative to OnMouseOver that doesn’t fire when the component is disabled?