How to test colliders C#

I have a rotating ball on a plane that the player rotates. I need to test/check to see that the ball is still on the plane (that way, if not, I can stop the game).

I’ve tried using raycast with no success, and that seems to be because both objects have the ability to rotate. Here’s what I’ve used:

        Vector3 Up = transform.TransformDirection(Vector3.up);
        if (Physics.Raycast(transform.position, Up, 10))
            print("There is something in front of the object!");

It seems I need to not only check if the two objects are touching, but I need to check a little radius around the ball since it can end up slightly off the plane if you tilt the plane to it’s extremes. I thought raycast would be perfect here, but no avail. Thanks for the help.

public void OnCollisionStay(Collider col)
if (col.gameObject.tag == “wall”)
Debug.Log(“There is something in front of the object!”);

with that script attached to the plane and the sphere tagged as a wall or vice versa.

I did it like this:
(By the way my character controller etc are all written in C#. I can give you the package if you would like, just send me a message

using UnityEngine;
using System.Collections;

public class CrouchC : MonoBehaviour {
	public float walkSpeed = 7.0F;
	public float crouchSpeed = 3.0F;
	public float runSpeed = 20.0F;

	private CharacterMotorC chMotor;
	private CharacterController ch;
	private Transform tr;
	private float dist;
	private bool release = false;
	private float vScale = 1.0F;
	private float speed;

	void Start(){
		chMotor = GetComponent<CharacterMotorC>();
		tr = transform;
		ch = GetComponent <CharacterController>();
		dist = ch.height / 2;
		speed = walkSpeed;

	void Update(){
		InputCheckingRule ();
		ApplyChanges ();

	public void InputCheckingRule(){
		if (release == false) {
			vScale = 1.0F;
			speed = walkSpeed;
		if (chMotor.grounded && Input.GetKey ("left shift") || Input.GetKey ("right shift")) {
			speed = runSpeed;
		if (Input.GetKey ("right shift")) {
			vScale = 0.35F;
			speed = crouchSpeed;
			release = true;
		if (Input.GetKeyUp ("right shift")) {
			release = true;
		if (release == true) {

	public void ReleaseCheckingRule(){
		Vector3 Up = transform.TransformDirection(Vector3.up);
		if (Physics.Raycast (transform.position, Up, 10)) {
						release = true;
				} else {
			release = false;

	public void ApplyChanges(){
		chMotor.movement.maxForwardSpeed = speed;
		float ultScale = tr.localScale.y;
		Vector3 temp = tr.localScale;
		temp.y = Mathf.Lerp (tr.localScale.y, vScale, 5 * Time.deltaTime);
		tr.localScale = temp;
		Vector3 temp2 = tr.position;
		temp2.y += dist * (tr.localScale.y - ultScale);;
		tr.position = temp2;