Answer the question
In order to leave comments, you need to log in
How to correctly determine if a button is pressed in a [Unity] trigger?
When I get to the trigger, then 1 displays... but when I press E nothing happens.
void OnTriggerEnter2D(Collider2D col){
if (col.gameObject.name == "Player"){
print ("1");
if (Input.GetKey (KeyCode.E))
print ("Open");
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question