Hello i have 3d Sphere and i would like to change the interactable property by code, but i have an error Object reference not set to an instance of an object when i try to set the boolean value. Please note that the script is attached to the 3d Object
this is my code
using System.Collections;
using UnityEngine;
public class Drag : MonoBehaviour
{
public Button obj;
void Awake()
{
Button obj = GameObject.Find("Sphere").GetComponent<Button>();
}
void Start()
{
this.obj.interactable = false;
}
}
thanks in advance