So im new to unity and wanted to ask some basic stuffs. For example if i wanted to create a basic 2D game that would let players click on objects on flat 2d space and images (something like hidden objects game), what would be the right way to detect that an object has been clicked? a. Place individual scripts on each clickable objects? b. Use raycast and any tips and workflow resources to making a type of this game is greatly appreciated.
I'd go with raycast, or rather OverlapPoint. Something like this: Code (CSharp): Vector2 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); Collider2D hitCol = Physics2D.OverlapPoint(mousePos);