what's wrong with my raycast object report code?

I’m working on a turn based grid game. think checkers. I’m really proud of myself for making the randomized grid map without any help from plugins, but the trouble started when I tried to make the objects start interacting. What I need this code to do is create a “go right” button which sends a ray from the object to the right one unit. if the raycast hits an object tagged enemy, I need the player object to move two units like he’s jumping him (checkers). otherwise I just need the player object to move one space.

As you can see, I am having trouble just getting the ray to report an object. I have tried many solutions: from triggerEnters to Rays; from kinematic onTriggers to box collider rigidbodies. The only thing that seems to be consistent is that either collisions are ALWAYS happening or NEVER happening.

function OnGUI(){
	if(myTurn){
		//move/jump right
		if(GUI.Button(Rect(Screen.width/2 + 100, Screen.height/2, 75,75), moveRightButton)){
			var hit : RaycastHit;
			var myRay = new Ray(myPos, Vector3.right);
			if(collider.Raycast(myRay, hit,1)){
				if(hit.collider.gameObject.tag == "Enemy"){
				Debug.Log("this is awkward");
				}
			}
		}
	}
}

Mostly, I just need a fresh pair of eyes to make sure my ray is in the right format. If you can think of a better way to do this, let me know. I also want to make the player object keep “jumping” if more than one enemy is lined up. If you’re feeling abstract, do you have any ideas for a looping function that repeats the jump routine until there’s no more enemies? But most importantly, what’s going on with my Raycast?
Thank you very much for your time.

One issue is that you are using Collider.Raycast(). Collider.Raycast() only casts against a specific collider. In this case you are Raycasting against the object this script is attached to. Since you are inside the object and mesh are one sided, you won’t hit anything. Replace your ‘collider.Raycast’ with Physics.Raycast:

if (Physics.Raycast(myRay, hit, 1)) {