foreach (GameObject boxObj in boxManager.boxesObject)
{
if (boxObj.transform.position.Equals(nextBoxPosition))
{
boxObj.SendMessage("CanBoxMove");
}
}
I have this foreach loop that checks if the position of the box after being pushed is equal to the position of another box, and I want to make it so that when there is nothing in front of the box it can be pushed. For that I need to make it so it runs the code to move it when no box is detected in the next position