Hello, does anyone know how to make a character selection like the one in the Ballz mobile game?
I have watched a YouTube tutorial on how to do it and came up with this script :
private List<GameObject> balls;
private int selectionIndex = 0;
private void Start()
{
balls = new List<GameObject>();
foreach(Transform t in transform)
{
balls.Add(t.gameObject);
t.gameObject.SetActive(false);
}
balls[selectionIndex].SetActive(true);
}
private void Update()
{
}
public void Select(int index)
{
if (index == selectionIndex)
return;
if (index < 0 || index >= balls.Count)
return;
balls[selectionIndex].SetActive(false);
selectionIndex = index;
balls[selectionIndex].SetActive(true);
}
Now, instead of the gameobjects to get inactive, what I want instead is to change the outline color of the gameobjects and change a text inside the gameobject. How would I do that? I’m still new to coding and have no idea.