EDIT: IT’S NOT THE THIRD IF THAT WASN’T WORKING, IT WAS THE SECOND “&&” THAT I INCLUDED THAT CAUSED THE SCRIPT TO NO LONGER WORK
The land would no longer develop once I added the second “&&” but would develop once I commented out the second “&&” and kept the third if statement enabled.
//IF RAY HITS ROAD AND POWER POLE AND WATER PIPE, LAND IS DEVELOPED
if (hitInfo.collider.CompareTag("RoadTag") && hitInfo2.collider.CompareTag("PowerPoleTag") && hitInfo3.collider.CompareTag("WaterPipeTag"))
{
// Check if ray from the un-developed land is hitting a collider (road collider, power pole collider)
//ROAD
if (hitInfo.collider != null) //The inequality operator != returns true if its operands are not equal, false otherwise.
{
//POWER POLE
if (hitInfo2.collider != null)
{
//WATER PIPE
if (hitInfo3.collider != null)
Debug.Log("ray hit road"); //this debug is not being read
hitCount++;
StartCoroutine(StartDelay()); //wait 7 seconds for land to develop.
Debug.Log("Land Developed");
}