I’m trying to create a card based game and for UI purposes I have specific slots but I need the script to be able to tell which cards are available and for that I need it to only search for ones that meet a certain condition this is my script:
private void Awake()
{
}
private void OnTriggerEnter(Collider other)
{
Instantiate(card, transform.parent = cardspace.transform);
Destroy(gameObject);
print("one more card collected");
}
private void Update()
{
cardspace = FindObjectOfType<CardSpace>(cardspace.available == true);
}
When I add the (cardspace.available == true) to my find object it is unable to detect any of them, is there a workaround, or am I doing something wrong