Find GameObject by its Vector3 coordinates

I am new to Unity, but I’ve been developing in C# for years. I am building a simple match 3 game to start with, but I am stuck when doing the actual match. I can work out the adjacent tiles’ coordinates, but I need to get the GameObject to check its type/color to match it. Can I get to the GameObject using the Vector3 coordinates?

There are also lots of mouse functions you can override in MonoBehaviour: OnMouseEnter, OnMouseDown, OnMouseExit, to name a few. They probably use raycasting behind the scenes as well, but are simpler to use.

If you insist on finding the gameobject by its position, then you need to iterate through all GameObjects in the scene and check their transform.position.

I assume you are clicking on the objects you want to test? If so, then raycasting will do what you want. Basically, it will return the object you clicked on to you (assuming you set it up correctly).

More on raycasting can be found here: Unity - Scripting API: Physics.Raycast

A closer solution to your specific problem can be found here: Using RayCast to Get Mouse Input - Questions & Answers - Unity Discussions