I am currently on a tic tac toe project and I need to code the draw system. to do that, I need to effectively check whether any of the circles or crosses and place and if so, set the corresponding boolean to true, or at least that is the method I have come up with. Once all are true, A draw boolean in another script is set to true and if there are no wins the game will end. The circles and crosses are numbered to their corresponding position on the grid and will have to be reached from another script named Variables.
here is my messed up rubbish script
`
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Draw : MonoBehaviour
{
bool GridSpace_1;
bool GridSpace_2;
bool GridSpace_3;
bool GridSpace_4;
bool GridSpace_5;
bool GridSpace_6;
bool GridSpace_7;
bool GridSpace_8;
bool GridSpace_9;
Variables Var;
void Start()
{
Var = GetComponent<Variables>();
}
void Update()
{
for (int i = 9; i > 0; --i)
{
if (Var.Circle_*.transform.position.y != 10)*
{
//WHY IS THERE AN ERROR
}
}
}
}
`
P.S. IT DOESNT WORK