i have a small problem with OnMouseDown function. It doesnt detect my mouse clicks after i move the camera. Here is my camera moving script:
if(Input.GetKey(KeyCode.D))
{
Camera.main.transform.position = new Vector2(10 * Time.deltaTime, 0);
}
if (Input.GetKey(KeyCode.A))
{
Camera.main.transform.position = new Vector2(-10 * Time.deltaTime, 0);
}
So, when i enter the game and dont click "A" nor "D" button, everything works fine. However, when i click it OnMouseDown function stops detecting my clicks. In addition to that my gamemobjects that have a script with OnMouseDown function after moving the camera visually change size, as seen here.
So what my game do is I instantiate a prefab few times (lits say 100). This prefab has script with OnMouseDown attached to it. My Camera movement script is attached to main camera. There is no direct references between prefab script and camera control script. What OnMouseDown basicaly do is loads up data from clicked object and show it on screen.
Thanks for any help!