2D Toolkit Forum
2D Toolkit => Support => Topic started by: mochatony on March 11, 2013, 05:29:13 am
-
Hi,
I am having problem with getting OnMouseDown and OnMouseEvent for TK2DSprite that have mesh collider. But, it works fine for TK2DSprite with box collider implemented.
My question is how do I get OnMouseDown event to works for sprite that implement mesh collider. Thank you
Some of my codes below:
using UnityEngine;
using System.Collections;
public class Crate : MonoBehaviour {
void OnMouseDown() {
Debug.Log("MouseDown");
}
void OnMouseUp() {
Debug.Log("MouseUp");
}
}
-
You will need to enable Collider Caps (front / back / both) so there is something for the ray to hit. By default, the mesh collider created in tk2d doesn't have any caps at all to reduce polygon count.
-
Thanks. Solved the problem.