vendredi 8 janvier 2021

Multiple component references in an if/then logic statements in Unity?

How do you make multiple component references in a single if/then logic statements in Unity? I thought it would look something like this:

if(other.GetComponent<Component1>() != null || (Component2>() != null)
     {
     //Run code
     }

Such code returns this error:

error CS1026: ) expected

Aucun commentaire:

Enregistrer un commentaire