Hi guys I need you help I got a bit of a problem with my code. I still dont know which gameobject it is referring to since typeofanims has been declared to copy an enum from another script. Trying to compare two objects by using enum as their types. Thank you in advance =)
public game3_objectdrop.Slot typeofanims = game3_objectdrop.Slot.chicken;
void OnTriggerEnter(Collider other)
{
if ( other.tag == "cube")
{
game3_objectdrop t = gameObject.GetComponent<game3_objectdrop>();
if (typeofanims == t.typeofAnims)
{
Debug.Log("You touch me");
touchme = true;
gameObject.transform.position = other.transform.position;
gameObject.transform.SetParent(other.transform.parent);
}
else
{
originalPosition = gameObject.transform.position;
}
}
}