unity oncollisionenter2d
C#
void OnCollisionEnter2D(Collision2D col)
{
//This method will run when your 2D game object
//collides with something
Debug.Log("Collided");
}using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour {
void OnCollisionEnter2D(Collision2D coll) {
if (coll.gameObject.tag == "Enemy")
coll.gameObject.SendMessage("ApplyDamage", 10);
}
}
Also in C#:
- Title
- c# convert to int
- Category
- C#
- Title
- C# delegate
- Category
- C#
- Title
- c# groupby date
- Category
- C#
- Title
- c# index in select
- Category
- C#
- Title
- convert array to list Unity C#
- Category
- C#
- Title
- MVC creating a counter for products
- Category
- C#
- Title
- rotate to face direction
- Category
- C#
- Title
- csharp attributes as generics constraints
- Category
- C#
- Title
- page refresh on button click in c#
- Category
- C#
- Title
- unity c# is not equal to
- Category
- C#
- Title
- c# merge two xml files
- Category
- C#
- Title
- unity multiply xyz of two vectors
- Category
- C#
- Title
- max of array C#
- Category
- C#
- Title
- unity prevent system from creation
- Category
- C#
- Title
- linq c# object except two lists
- Category
- C#
- Title
- pop up element from specific index in array
- Category
- C#
- Title
- c# loop datatable rows
- Category
- C#
- Title
- set rotation to velocity unity
- Category
- C#
- Title
- reverse string c#
- Category
- C#
- Title
- sending data photon c#
- Category
- C#
- Title
- c# string replace comma with newline
- Category
- C#
- Title
- float to int c#
- Category
- C#
- Title
- get absolute url c#
- Category
- C#
- Title
- how to make a game
- Category
- C#
- Title
- question mark operator in c#
- Category
- C#
- Title
- c# cancellationtoken
- Category
- C#
- Title
- c# ?
- Category
- C#
- Title
- unity try get component
- Category
- C#
- Title
- open new window c# wpf
- Category
- C#
- Title
- how to set a transform equal to something unity
- Category
- C#
- Title
- C# array to label
- Category
- C#
- Title
- unity search for specific text in a string
- Category
- C#
- Title
- c# superclass constructor
- Category
- C#
- Title
- transform object according to its parent unity
- Category
- C#
- Title
- replace double backslash with single backslash c#
- Category
- C#
- Title
- c# get set
- Category
- C#
- Title
- c# get value of object in enum
- Category
- C#
- Title
- how to turn 3 floats into quartenion
- Category
- C#
- Title
- accessing form controls from another class c#
- Category
- C#
- Title
- unity switch to scene and transfer data
- Category
- C#
- Title
- how to retrive an enum string value instead of number in c# controller
- Category
- C#
- Title
- page parent wpf
- Category
- C#
- Title
- unity set list of strings
- Category
- C#
- Title
- list.addrange in c#
- Category
- C#
- Title
- unity no serializefield
- Category
- C#
- Title
- windows forms iterate through all controls
- Category
- C#
- Title
- .netstandard distinctby iqueryable
- Category
- C#
- Title
- Could not load file or assembly 'Ubiety.Dns.Core, Version=2.2.1.0
- Category
- C#
- Title
- how to initiate a varaible in cs
- Category
- C#
- Title
- get type of variable c#
- Category
- C#
- Title
- c# tostring mmm dd yyyy
- Category
- C#
- Title
- how to start grid from where the data starts in c# charts
- Category
- C#
- Title
- random class
- Category
- C#
- Title
- unity c# write line
- Category
- C#
- Title
- unity set text value
- Category
- C#
- Title
- c# wpf row definition height * in code
- Category
- C#
- Title
- c# reverse string
- Category
- C#
- Title
- c# error CS0120
- Category
- C#
- Title
- unity round vector 3 to nearest integer
- Category
- C#
- Title
- c# capitalize first letter
- Category
- C#
- Title
- how to see if they are aholding down a key unity
- Category
- C#
- Title
- c# dictionaries
- Category
- C#
- Title
- toggle unity c#
- Category
- C#
- Title
- c# negation
- Category
- C#
- Title
- C# function return datareader
- Category
- C#
- Title
- split on uppercase c#
- Category
- C#
- Title
- unity requirecomponent
- Category
- C#
- Title
- how do I attach a player with a navMeshAgent
- Category
- C#
- Title
- c# abstract class
- Category
- C#
- Title
- c# exit for
- Category
- C#
- Title
- unity print
- Category
- C#
- Title
- unity create a child object
- Category
- C#
- Title
- unity resources load
- Category
- C#
- Title
- asp list box
- Category
- C#
- Title
- unity 3d character controller
- Category
- C#
- Title
- firefoxoptions setpreference to trust certificates
- Category
- C#
- Title
- unity quaternion
- Category
- C#
- Title
- how to name GameObject in c#
- Category
- C#
- Title
- C# colours
- Category
- C#
- Title
- iterate through xpdictionary devexpress
- Category
- C#
- Title
- x angle oes back after 90 unity
- Category
- C#
- Title
- rotate player unity
- Category
- C#
- Title
- csharp check if env is development
- Category
- C#
- Title
- c sharp comments
- Category
- C#
- Title
- docker ssh
- Category
- C#
- Title
- how to randomly rotate rigidbody of object in unity
- Category
- C#
- Title
- c# using get set methods
- Category
- C#
- Title
- C# extend array
- Category
- C#
- Title
- c# windows application get current path
- Category
- C#
- Title
- unity how to get transform scale
- Category
- C#
- Title
- unity connect to firebase
- Category
- C#
- Title
- how to trim path in C#
- Category
- C#
- Title
- MVC company assignments
- Category
- C#
- Title
- c# how to sort a list
- Category
- C#
- Title
- unity3d quaternion add 90 degrees
- Category
- C#
- Title
- unity custom update
- Category
- C#
- Title
- how to cjeck if a string has a word c#
- Category
- C#
- Title
- razor preview
- Category
- C#
- Title
- c# datafield change cell background color
- Category
- C#
- Title
- unity delete specific text in a string
- Category
- C#