Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class kos : MonoBehaviour {
- public Transform metal;
- public float a = 0.001f;
- void OnCollisionEnter(Collision collision)
- {
- Destroy(gameObject);
- foreach(ContactPoint contact in collision.contacts)
- {
- Quaternion ConRot = Quaternion.FromToRotation(Vector3.up, contact.normal);
- Instantiate(metal , contact.point+(contact.normal*a), ConRot);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement