I was creating a script to find all gameObjects with a certain layer but in the if statement I get an error:
“Operator ‘==’ cannot be applied to operands of type ‘int’ and 'string”. Any solution?
GameObject gos = GameObject.FindObjectsOfType(typeof(GameObject)) as GameObject;
foreach (GameObject go in gos)
{
if(go.layer == "Player")
{
}
}