Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. void OnCollisionEnter2D(Collision2D col)
  2.                 {
  3.                 if (col.gameObject.tag == "HardFloor" && col.relativeVelocity.magnitude > 100)
  4.                     {
  5.                             Debug.Log ("There has been a collision!");
  6.                             Destroy (col.gameObject);
  7.                     }
  8.                 else if (col.gameObject.tag == "otherTarget")
  9.                     {
  10.                             Debug.Log ("There has been a collision!");
  11.                             Destroy (col.gameObject);
  12.                     }
  13.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement