Tuesday, February 19, 2019

Unity 3d Destroy Objects On Trigger full script by allunityscripts

Destroy On Trigger

unity 3d full script Destroy objects OnTrigger


using UnityEngine;
using System.Collections;

public class DestroyOnTrigger : MonoBehaviour
{
    public GameObject objToDestroy;
    public GameObject effect;

     // Visit Allunityscripts.blogspot.com for more scripts

    // Use this for initialization
    void OnTriggerEnter(Collider other)
    {
        if(other.gameObject.tag == "Player")
            Instantiate(effect, objToDestroy.transform.position, objToDestroy.transform.rotation);
            Destroy(objToDestroy);
    }
}

2 comments:

  1. As a IT Exam Material Seller, I think Implementing HP JetAdvantage Secure Print and Insights is easiest IT Certification. It’s in demand now a days. Certificationgenie offers best preparation study material for HP2-H84 exam questions answer files for all types of IT Certification Exams.

    ReplyDelete