Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Cannot convert type 'UnityEngine.GameObject' to 'GameObject'

$
0
0
Hello all, I keep getting the error: error CS0030: Cannot convert type 'UnityEngine.GameObject' to 'GameObject'. Due to that everything below is the loop is also giving errors, but they should be fixed after i fix the loop. My code is provided below. Im also pretty new to foreach loop, maybe im messing up there? Thanks in advance. // iterates through pooledObstacles and return the pooledObstacle if it is not active in hierarchy foreach (GameObject i in pooledObstacles) { if(!i.activeInHierarchy) { i.SetActive(true); return i; } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles