- Home /
Question by
webicindia · Nov 26, 2016 at 07:38 PM ·
c#collisiononcollision
i can see my objects collide but OnCollisionEnter never called c#
object 1 has
Rigid body 2d:: is kinematic(unchecked)
fixed joint 2d
circle collider 2d::is triger (unchecked)
c# script
object 2 has
circle collider 2d::is triger (unchecked)
script using
using UnityEngine;
public class onColOccurs : MonoBehaviour {
void OnCollisionEnter(Collision collision)
{
Debug.Log("OnCollisionEnter");
}
}
i can see both objects collide and stop yet function i not called any help would be great thanks
Comment
Best Answer
Answer by josehzz112 · Nov 26, 2016 at 07:55 PM
You are using 3D functions for 2D behaviour, change your code to this.
void OnCollisionEnter2D(Collision2D collision)
{
Debug.Log("OnCollisionEnter");
}
Your answer
Follow this Question
Related Questions
OnCollision using Orthello2D Framework is causing NullReferenceException 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Take health from enemy 3 Answers
Question about collision 2 Answers