Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

oncollisionenter is declared but never used


//The problem is that you need to move this out of a void [e.g. void Start() or void Update()] 

void OnCollisionEnter(Collision collision)
    {
        if (other.gameObject.tag == "Object") 
         {
             Debug.Log ("Collided");
         }
    }

//Also same with OnCollisionEnter2D, OnTriggerEnter and OnTriggerEnter2d
Comment

PREVIOUS NEXT
Code Example
Csharp :: messagebox yes-no 
Csharp :: minimize window form c# 
Csharp :: how to load the active scene unity 
Csharp :: how to make mouse invisible unity 
Csharp :: read text file to string c# 
Csharp :: unity change tag in script 
Csharp :: c# char input 
Csharp :: c# how to run external program 
Csharp :: center an image horizontally and vertically 
Csharp :: c# random number 
Csharp :: Time delay C# unity 
Csharp :: c# exit console 
Csharp :: unity get mouse position 
Csharp :: Getting data from selected datagridview row and which event 
Csharp :: get self component in unity 
Csharp :: how to set a custom size for window in monogame 
Csharp :: unity application quit 
Csharp :: clone gameobject unity c# 
Csharp :: c# append to file 
Csharp :: unity color set alpha 
Csharp :: how to make a method wait in unity 
Csharp :: setactive unity 
Csharp :: unity raycast all layers except one 
Csharp :: c# try catch with error message 
Csharp :: c# socket bind to localhost 
Csharp :: c# press key 
Csharp :: unity scenenmananger 
Csharp :: backcolor c# hexadecimal 
Csharp :: How To Copy a text C# unity 
Csharp :: #3d271d 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =