Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

on collision enter by layer 2d unity

     void OnCollisionEnter(Collision collision)
     {
         if (collision.gameObject.layer == 8/*the layer number*/ )
             debug.log(collision.gameObject.layer.number.ToString() "touched")
	}
 
PREVIOUS NEXT
Tagged: #collision #enter #layer #unity
ADD COMMENT
Topic
Name
8+2 =