Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

ontriggerenter2d

 void OnTriggerEnter2D (Collider2D other) //Make sure to put this out of Voids
     {
         if (other.gameObject.tag == "Object") 
         {
             Debug.Log ("Collided");
         }
Comment

ontriggerenter2d

    void OnTriggerEnter2D(Collider2D col)
    {
        Debug.Log(col.gameObject.name + " : " + gameObject.name + " : " + Time.time);
        spriteMove = -0.1f;
    }
Comment

ontriggerenter2d not working

Unity Monobehavior Lifecycle methods start with a capital and C# methods are case-sensitive.
Therefore, the following methods need to be corrected to be used by Unity:
onTriggerEnter2D => OnTriggerEnter2D
Comment

PREVIOUS NEXT
Code Example
Csharp :: C# ValidationAttribute required when 
Csharp :: store data between razor pages 
Csharp :: how to check url has parameter in c# 
Csharp :: redis cache repository .net 
Csharp :: how to create a blazor client-side application in a command-line interface 
Csharp :: interop C# save as and replace 
Csharp :: Comparing Arrays using LINQ in C# 
Csharp :: Merge two List using Linq 
Csharp :: game maker transparent 
Csharp :: pricipal permission attribute in c# 
Csharp :: how to download somthing from one drive unity 
Csharp :: Lambda Expression to filter a list of list of items 
Csharp :: how to iterate string in c# 
Csharp :: c# double without exponential notation 
Csharp :: begininvoke async c# 
Csharp :: C# checking if a value is a int 
Csharp :: vb.net windows version check 
Csharp :: unity error log 
Csharp :: c# xml check if attribute exists 
Csharp :: StringFormat C# 
Csharp :: check if multiple variables are null c# 
Csharp :: long string c# 
Csharp :: how to return array in function c# 
Csharp :: why to make private fields readonly in c# 
Csharp :: implicit vs explicit cast c# 
Csharp :: camelCase and snakeCase 
Csharp :: c# code snippets 
Csharp :: google mobile ads app id 
Csharp :: if exercises c# 
Csharp :: Count Rows of table using Linq 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =