Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

oncollisionenter unity

void OnCollisionEnter(Collision collision) {
       if (collision.gameObject.tag == "Door")
       {
               // DoorScript is the name you gave to the script on the door
               DoorScript script = collision.gameObject.GetComponent<DoorScript>();
               // OpenDoor is a method in your door object's script
               script.OpenDoor();
       }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: phone number regex in c# 
Csharp :: c# count specific element in list 
Csharp :: Add float value to ui text in unity 
Csharp :: unity convert mouse position to world position in editor mode 
Csharp :: set mouse over colors for button wpf 
Csharp :: c# connection string 
Csharp :: linq select count group by c# 
Csharp :: ef database first generate models entity framework core 
Csharp :: how to update a project to cross target .net core 
Csharp :: c# system.drawing.color to system.windows.media.color 
Csharp :: get current directory cosmos 
Csharp :: C# infinite clock coroutine loop 
Csharp :: c# find index element array 
Csharp :: winforms messagebox with button 
Csharp :: C# metodas duomenu paemimui veiksmams ir grazinimui 
Csharp :: how to write switch statement unity 
Csharp :: unity cinemachine lock camera axis 
Csharp :: c# unity camera follow 
Csharp :: removing illlegal char from filename 
Csharp :: unity detect object with raycast 
Csharp :: object list to csv c# 
Csharp :: elevated priviledge in c# 
Csharp :: how to remove last 3 characters from string in c# 
Csharp :: c# rename file add 
Csharp :: c# get random double in range 
Csharp :: c# convert string to enum 
Csharp :: All SQL Server Tables in a Schema 
Csharp :: How can you learn C# on your own 
Csharp :: boostrap 4 modal 
Csharp :: c# entity framework code first connection string 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =