Answers for "unity 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
16

unity oncollisionenter

void OnCollisionEnter(Collision col)
    {
		//This method will run when your game object
      	//collides with something

      	Debug.Log("Collided");
    }
Posted by: Guest on February-15-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

C# Answers by Framework

Browse Popular Code Answers by Language