I want access to a component of a UI Button and want to enable a disabled component " Button(Script)" for unlocking the next level but it is not enable the component.
if(PlayerPrefs.GetInt("Level") == 1){
Button Level2 = Unlock.GetComponent<Button>();
Level2.enabled = true;
}
P.S: No Syntax Error in my code.
Level2is null by puttingDebug.Log(Level2)inside that if statement.. This will also tell you if thatifthat statement is even running.