Answers for "oncollisionenter2d"

C#
10

unity oncollisionenter2d

void OnCollisionEnter2D(Collision2D col)
    {
		//This method will run when your 2D game object
      	//collides with something

      	Debug.Log("Collided");
    }
Posted by: Guest on February-15-2020
2

unity 2d collision

void OnCollisionEnter2D(Collision2D col) {
  Debug.Log("Collided with: " + col.gameObject.name);
}
Posted by: Guest on October-14-2020
3

oncollisionenter2d

using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour {
    void OnCollisionEnter2D(Collision2D coll) {
        if (coll.gameObject.tag == "Enemy")
            coll.gameObject.SendMessage("ApplyDamage", 10);
        
    }
}
Posted by: Guest on April-08-2020
0

oncollisionenter2d

void OnCollisionEnter2D(Collision2D collision) //Make sure to put this out of Voids
    {
        if (other.gameObject.tag == "Object")
        {
            Debug.Log ("Collided");
    	}
    }
Posted by: Guest on February-22-2021
0

oncollisionenter2d

OnCollisionEnter2D(Collision2D Collider)
Posted by: Guest on September-03-2020

Code answers related to "oncollisionenter2d"

C# Answers by Framework

Browse Popular Code Answers by Language