#if( GetComponent ) { ... }
1 messages · Page 1 of 1 (latest)
If you want to test if the component was recieved, I recommend using TryGetComponent(); (if you want to use that component)
// try to get component (if it is successful, you "out" the component and can use that)
if (TryGetComponent(out Experience experience))
{
// code
}
But I believe that that method could also work. If it doesn't, you can always check if the GetComponent returns null.