Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

on collision 2d unity

//Detects when collided with a 2D collider
//make sure to add box collider 2D and tick the is Trigger checkbox
//then create a script and add this in it
    void OnCollisionEnter2D(Collision2D col)
    {
        Debug.Log("2D Collision");
    }
 
PREVIOUS NEXT
Tagged: #collision #unity
ADD COMMENT
Topic
Name
4+6 =