- Home /
 
 
               Question by 
               tr3intaydos · Aug 15, 2011 at 02:38 AM · 
                raycastcollidertriggerray  
              
 
              Box Collider wont trigger a Trigger after moveing the object
im doing some movement with the elevator this way, this script is attached in the player:
 var pos : int = 0;
 function Update(){
     var hit : RaycastHit;
     if (Physics.Raycast (transform.position, -Vector3.up, hit, 100.0)) {
         if(hit.collider.gameObject.tag == "Elevator"){
            if(pos == 0)
                hit.collider.transform.position += Vector3.right * Time.deltaTime * vel;
            else if(pos == 1)
                hit.collider.transform.position += -Vector3.right * Time.deltaTime * vel;
         }
     }
 }
 
               and i have a trigger where is supposed to stop this movement and change the var 'pos' to 1, but the plataform wont activate the trigger, the player does though.
               Comment
              
 
               
              Your answer