I’m new to Unity (though I have worked in other engines) and I’m having a bit of an issue with 2D collision.
Right now I have two objects that are colliding.
Both have Rigibody2D component.
One is Kinematic, the other is non-kinematic.
Both have box colliders
I have a C# script that is calling void OnCollisionEnter(Collision col){}
and yet nothing happens. Collision doesn’t appear to be registering at all. Most engines I’ve used require collision functions to be hooked up via events or some such system, but my understand is that Unity has all of this already set up? As such, I’m a bit confused as to why it’s not work. All of the tutorials I can find seem to simply say that this should work.
note: Additionally, I’ve tried “OnCollisionEnter2D()”, I’m not sure if that’s a function, but I read a help forum post that suggested there was a difference between OnTriggerEnter() and OnTriggerEnter2D(). This also did not work.
edit: Let me rephrase. Collision -does- register at least on the physics side. The objects cannot pass through one another by means of velocity, but I can’t seem to get my script to hear these events. It’s just my custom OnCollisionEnter() that is never called.
Thanks a ton!