Hiya,
I really need some help, I seem to have been trying this in quite a few ways and none seem to work.
I have three cubes with three different tags, they all have box colliders on that are set to istrigger, the OVRHand (which is basically my player) has a rigidbody and a sphere collider on (trigger is on); I wrote this code and it worked fine when i only had one object of tag “RedBloodCell”, however when i added the other two, it stopped working.
What I would want ideally is that the player has to touch all the three object types (there will be multible obj of each type) before an animation is triggered, but for now I’m testing it with the destroy function.
Can anyone help figure out, how to write a script that sets it as a condition that all types have to be trigged for something to happen.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OnTriggerDestroy : MonoBehaviour
{
private void OnTriggerEnter(Collider col)
{
{
if (col.gameObject.tag == "RedBloodCell" && col.gameObject.tag == "WhiteBloodCell" && col.gameObject.tag == "PlateletCell")
{
Destroy(col.gameObject);
}
}
}
}