GameObject to GameObject

I get the error cannot convert game object to gameobject with the following code. I am just trying to fill a game object array with game objects…whats up with that?

var draggables : GameObject[];
	for (x=0;x<4;x++)
	{
		draggables[x] = GameObject.FindGameObjectsWithTag ("isClickableGui");
	}

The method itself returns an array not a gameobject, so not sure what your for loop is there for.

var draggables : GameObject[];
draggables = GameObject.FindGameObjectsWithTag ("isClickableGui");

The method FindGameObjectsWithTag() returns a GameObject array. You are using it like it returns a single GameObject.

Try just writing

var draggables = GameObject.FindGameObjectsWithTag ("isClickableGui");

EFB :wink: