- Home /
Question by
King_Arsl · Jun 27, 2015 at 11:35 PM ·
javascriptobjecttouchdetection
Touch Detection on Object in javascript
i want to move my character to the object which i touched kindly please help i m new in unity. i found a code but it is in c# and i need in javascript.
if (Input.touchCount == 1)
{
Vector3 wp = Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position);
Vector2 touchPos = new Vector2(wp.x, wp.y);
if (collider2D == Physics2D.OverlapPoint(touchPos))
{
left_move = 1;
}
}
Comment