Raycast only going sometimes

My Raycast is casting, but only once every five or so times I want it to. I haven’t been able to figure out a pattern for when it triggers.

I have the following in Update:

if (mainScript.bombExpload) 
			Ray bombRay = new Ray (transform.position, mainScript.bombForceD);
			RaycastHit bombHit;
			print (bombRay);

			if (Physics.Raycast (bombRay, out bombHit, 2)) 
				print ("ray");
				Debug.DrawRay (transform.position, mainScript.bombForceD, Color.green, 10); //origin, direction, color, seconds to remain

			mainScript.bombExpload = false;

“mainScript.bombExpload” is a bool that becomes true when the player collides with a bomb. “print (bombRay);” is in place to confirm that the issue is not with the bool change. It does trigger, once, every time.

“print (“ray”);” confirms that the issue isn’t the “Debug…” line. Every time the “Debug…” line goes “ray” is printed.

Thank you for any help!

You put the raycast inside of an If statement. Raycast returns TRUE if it hits something. Is it maybe just not hitting anything when you think it isn’t firing?