Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity 3d fire shoting

private void OnTriggerEnter(Collider other)
{
    if (other.CompareTag("Enemy"))  
    {
        // Destroy the thing tagged enemy, not youself
        Destroy(other.gameObject);

        // Could still destroy the bullet itself as well
        Destroy (gameObject);
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: basic math functions in c# 
Csharp :: unity camera movement script 
Csharp :: how to open or close combobox in c# 
Csharp :: c# 2 timespan return yesterday 
Csharp :: 110771 
Csharp :: pun 2 matchmaking custom room properties 
Csharp :: www.elking.net 
Csharp :: c# treeview keep selected node highlight 
Csharp :: unfreeze position in unity 
Csharp :: CharacterController 
Csharp :: version string c# 
Csharp :: c# generic type converter 
Csharp :: return last row if all other condition fails in linq c# 
Csharp :: difference between all logging framework .NET Core? 
Csharp :: asp.net web hooks 
Csharp :: get last id ef 
Csharp :: asp.net core reverse engineer database 
Csharp :: txtbox.fous in c# 
Csharp :: parse persian date string to datetime c# 
Csharp :: linq dynamic order by descending 
Csharp :: epmty char c# 
Csharp :: dotnet target specific framework 
Csharp :: html tag inside razor tag 
Csharp :: eager loading singleton c# dependency injection 
Csharp :: how to detected WindowCloseEvent in other window wpf 
Csharp :: unity having virtual start 
Csharp :: go to the corresponding brace visual studio C# 
Csharp :: constructor in protobuf-net 
Csharp :: C# .net JwtSecurityTokenHandler jwttoken claims to object 
Csharp :: list remove positions c# 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =