Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Destroy GameObject with Tag Unity

    //private void OnCollisionEnter ( Collision collision )
    //{
    //    if ( collision.collider.CompareTag ( "Player" ) )
    //    {
    //        Destroy ( collision.gameObject , 0.1f );
    //    }
    //}
    private void OnTriggerEnter ( Collider other )
    {
    //Box collider is triggered...Top Script box collider is nopt triggered
        if(other.CompareTag ("Player") )
        {
            //Destroy Colliding game Object

            Destroy ( this.gameObject );

            //Destroy other game objject to which collided

            Destroy ( other.gameObject );
        }
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to use curl in asp.net c# 
Csharp :: element click intercepted exception in selenium C# 
Csharp :: JsonConvert.DeserializeObject options camelcasing c# .net 
Csharp :: C# trim trailing zero 
Csharp :: Metadata publishing for this service is currently disabled 
Csharp :: unity input system 
Csharp :: why is called c# 
Csharp :: remove item from list in for loop c# 
Csharp :: Convert Json String to model Class or Object 
Csharp :: unity set parent canvas 
Csharp :: c# entity framework get all records from table 
Csharp :: System.Data.Entity.Core.EntityException: The underlying provider failed on Open 
Csharp :: class in c# 
Csharp :: c# obsolete class 
Csharp :: c# if isset 
Csharp :: how to sort a dictionary by value in c# 
Csharp :: player input manager join manually 
Csharp :: ultimate space cruiser 
Csharp :: how to access asp button of gridview 
Csharp :: reverse a linked list C# 
Csharp :: c# read excel file using epplus save to datatable 
Csharp :: ArgumentException: Input Key named: Fire1 is unknown 
Csharp :: wpf listboxitem event command 
Csharp :: c# json 
Csharp :: c# external ip 
Csharp :: c# selenium xunit testing 
Csharp :: Convert integers to written numbers C# 
Csharp :: c# short to int 
Csharp :: how to make a system to check if i see certain object in unity 
Csharp :: system.drawing.color to system.consolecolor 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =