bool = this, not working consistently..

I’ve done the exact same thing in another script in the same project, and it works just fine.
A bool is only true if it casts a ray and hits an object with “tag”.
What should happen is the bool “slotActive” should only be true while object tag “Touchable” is overhead.
Instead, slotActive just stays true, even if its not hitting anything.

I have the exact same code in another script, and it works just fine. The bool is only true if one thing is over another.
Nothing is throwing an error. Everything works just fine.

Thanks in advance!

void Update () {
		Vector3 goBack = new Vector3(0,0,-1);
		//Is there a follower on me?
		RaycastHit hit;
		if (Physics.Raycast(transform.position, goBack, out hit , 1000)) {
			Debug.Log ("There is someting above me");
			Debug.DrawRay(transform.position, goBack ,, 10000);
			slotActive = hit.collider.CompareTag("Touchable"); //This is the problem here...
			if (slotActive) {
				isFull = hit.collider.gameObject.GetComponent<followerAttributes>().inSlot;
				else { 
					isFull = false; 

Your problem is that all code setting ‘slotActive’ is inside the Raycast(). That means your code will only be (re)set to true or false if your raycast is hitting something. A quick fix s to put ‘isFull = false;’ on line 3. This will mean that it will only be set to true if the Raycast() hits/ and it hits an object with the “Touchable” tag.