I want to disable a component. That component is not attached to the game object(the game object that has the component i want to disable) How can i disable a component from a game object if im coding from another game object.
You’re going to need a reference to the other game object - you can use GameObject.Find, GameObject.FindGameObjectWithTag, or through the collision/trigger callbacks if that is relevant. Once you have that reference
GameObject ref = /*however you get this reference*/;
ref.GetComponent<CompToDisable>().enabled = false;