Could I get some help with this code?

#pragma strict

var speed = 5.0;

function Start (){}

function Update () { 
    //moving forward/back and left/right
    var x = Input.GetAxis("Vertical") * Time.deltaTime * speed * -1;
    var y = Input.GetAxis("Horizontal") * Time.deltaTime * speed * -1;
    transform.Translate(x, y, 0);
    //mouse controls
    if (Input.GetKeyDown ("escape"))
        Screen.lockCursor = false;

    transform.Rotate(0, 0, (Input.GetAxis("Mouse X") * 2));
    if (Input.GetButtonDown ("Jump"))
        rigidbody.AddForce(0, 100, 0);  
//stop clipping issues
function OnTriggerStay (touch : Collider){  
    if (touch.gameObject.GetComponent("clipcheck"))
        speed = 0.01;    

function OnMouseDown(){ 
    Screen.lockCursor = true; 

I have my character model, which has a box collider encompassing it. The character model has an invisible cylinder around its waist that has a circle collider attached.

I’m trying to lower to speed variable when the circle collider touches something. How do I do this?

Is the circle collider actually a trigger?

Ok so you need to change your code in OnTriggerStay to use the name of the object you are hitting. The code you have at the moment is trying to find a script called clipcheck.

function OnTriggerStay (touch : Collider){

    if ( =="clipcheck") {
      speed = 0.01;


Sphere collider, not circle. Circle is 2D.

Why do you need an invisible Cylinder ? A gameObject with only the collider would do the same.

Is that code on that gameobject, the one with the sphere collider ?

Are there any game object physically moved that can enter that object, or is it the one moving ? The latter case will not raise trigger events. There is a way, though.