Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class kos : MonoBehaviour {
  5.     public Transform metal;
  6.     public float a = 0.001f;
  7.  
  8.     void OnCollisionEnter(Collision collision)
  9.     {
  10.         Destroy(gameObject);
  11.        foreach(ContactPoint contact in collision.contacts)
  12.         {
  13.             Quaternion ConRot = Quaternion.FromToRotation(Vector3.up, contact.normal);
  14.             Instantiate(metal , contact.point+(contact.normal*a), ConRot);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement