Home > Software engineering >  How to drag text into list in Unity?
How to drag text into list in Unity?

Time:08-15

I have been following tutorial for TicTacToe game enter image description here enter image description here

Should SpaceText be in blue color, to allow it to drag it to list? How to fix this issue? SpaceText can't be dragged into Assets.

CodePudding user response:

The Space_list is a collection of type Text[], which means that you can only drag GameObjects that contain the enter image description here

So you need to open the SpaceText prefab and add the Text component to its root GameObject, then you will be able to drag and drop those SpaceText GameObjects init to the Space_list.

The blue box icon indicates that a GameObject is an instance of a prefab asset. What this means in a nutshell is that if you modify the prefab asset, then all instance of that prefab will also be affected by that change.

CodePudding user response:

SpaceText gameobjects should have Text component.

  • Related