Hello.
this is what I’ve been doing. (2D game project)
- Items are floating around(with Rigidbody2D, CircleCollider).
- generate triangle mesh dynamically(with PolygonCollider).
- get Items within triangle mesh.
but collision detection won’t work between items and triangle.
someone please let me know what’s wrong with this…
I have tried turn isTrigger both on/off, and isKinematic both on/off.
using UnityEngine;
using System.Collections;
public class PolygonColCtr : MonoBehaviour {
void OnCollisionEnter2d (Collision2D coll)
{
if (coll.gameObject.tag == "ITEM")
{
Debug.Log ("Caught ITEM!");
}
}
}