- Home /
              This question was 
             closed Apr 19, 2013 at 03:49 PM by 
             Loius for the following reason: 
             
 
            Duplicate Question
 
               Question by 
               WesterlyCarrot9 · Apr 19, 2013 at 03:16 PM · 
                javascriptphysicsdamageoncollisionenter  
              
 
              Possible Fall Damage OnCollisionEnter Won't Work!
I use the script you can see below so that when my first person controller falls down from the cube he is on up in the air, the message "Damage!" appears on the console. Later on, i'll try to make a code with health and damage and stuff but for now this won't work. My floor is a Plane but just for testing i used a Big Cube to land on with rigidbody on it since OnCollisionEnter requires one but it just won't work. Am i doing something wrong?
function OnCollisionEnter(hit : Collision){
 if(hit.gameObject.tag == ("Floor")){
     Debug.Log("Take Damage");
 }
} 
               Comment
              
 
               
               koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                