Hello,
This one is probably an easy one but i ain´t getting nowhere.
This is a 2d game.
I have 3 shops that i want to be able to walk in to if i press key:ArrowUp but that only works for the store called LUSH. I have the exact same collider (everyone is a trigger) on every store, but it only works for LUSH?! HOW could this be?
Im getting frustrated because this seems like a really small problem and i have solved greater ones before! Maybe i should just take a break and come back later…
Thank you!
btw, here is my script:
using UnityEngine;
using System.Collections;
public class enterShop : MonoBehaviour {
void OnTriggerEnter2D (Collider2D col){
if (Input.GetKeyDown(KeyCode.UpArrow)){
if (col.gameObject.tag == "Player"){
if (gameObject.name == "ShopCollider"){
Debug.Log ("SHOP");
}
if (gameObject.name == "SushiCollider"){
Debug.Log ("SUSHI");
}
if (gameObject.name == "LushCollider"){
Debug.Log ("LUSH");
}
}
}
}
}