Hi, (Sorry for my bad English)
I wrote script that change item which I’m holding:
void Update()
{
if (Input.GetKeyDown(KeyCode.Alpha1))
{
ItemInHand = 1;
Item1.SetActive(true);
Item2.SetActive(false);
}
}
And another script:
void OnTriggerStay(Collider other)
{
if (other.tag == "Player")
{
text.enabled = true;
intree = true;
Debug.Log("In trigger.");
if (Input.GetKeyDown(KeyCode.E) & ###ItemInHand = 1###)
{
text.enabled = false;
Invoke("one", 0.3f);
}
}
}
How to get ItemInHand value in second script?