hey i am a begginer and i am trying to enable/disable a object from another object with the script on it can someone help me how to do it cause i cant seem to find a working method to do it
Show us the code
Helpful links:
i looked at the same pages but still it didnt work
i dont know if this helps but the (buy bank) button is supposed to enable the (bank withdraw,deposit)

“it didn’t work” is not enough to describe your problem
Describe precisely how do you try to solve the problem, what do you expect to see and what do you see?
For example something like:
GameObject.Find("Buy Bank").SetActive(false);
Debug.Log("Disabling object");
should disable the object.
right now it says this “object reference not set to an instance of an object”

Which line produces the error? 14?
It can’t find the object. Are you sure it is in scene and its spelling is correct?
yeah 14
You probably don’t want to disable the GameObject running your script before it has had a chance to actually complete the script. That is what you are doing on line 13.
then i still get the same error
Like you can read in the documentation
.Find only returns active Gameobject so how your code looks like you just want to actived them. But Find won’t find them when they are inactive.
I wasn’t saying that was the source of your error, just that the hygienic thing would be to disable the object executing the logic AFTER you are done running any logic that it needs to run.
Without seeing the code for the other objects, I think that martinmr probably hit the nail on the head.
You can’t find something that is disabled, so if it really needs to be disabled you should cache it before doing so.
You have a couple of options for that, link the objects in the editor or find and cache them programmatically (can’t believe spellcheck highlights that lol) during Awake() and then disable them in their respective Start() methods.
i found a way to do it with a foreach loop,

thx for you help and time.