using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour
{
public GameObject resim;
bool canPress;
void Update(){
if(Input.GetKeyDown(KeyCode.E)){
if(canPress){
resim.SetActive(true);
}
}
}
void OnTriggerEnter(Collider player){
if(player.gameObject.tag == "Nesne"){//"Nesne" yazan yere oyuncumuzun içine gireceği objenin tagını tanıtınız.
canPress = true;
}
}
void OnTriggerExit(Collider player){ // karakterimiz değdiği yerden çıkarsa burayı kontrol edeceğiz
if(player.gameObject.tag == "Nesne"){
canPress = false;
}
}
}