why OnMouseDown is not working
Hi I have very strange problem . OnMouseDown is not working for some reason until that game object has any movement .
private void OnMouseDown()
{
Destroy(gameObject);
}
script with this code is attached to squere shape game object ( prefab ) . So if I click on that game object nothing is happening until that game object is moved . After that object has moved even a little - after that OnMouseDown is working and game object gets destroyed .
Anyone knows why is it happening ???
it is a 2D game . And game object needs to move only one time after that On$$anonymous$$ouseDown is working even if game objet have stoped movement . By movement I mean when game is running if object moves within the game the On$$anonymous$$ouseDown starts working . If object did not move the I can click on it forever and nothing will happen