My game’s bird’s eye view and i want to have a certain game object that gives input when the player’s on top of it
1.) Why not use collision?
2.) You -could- shoot a raycast down and check to see what you’re hitting. This is more expensive, though.
If it’s birds’-eye, just put a check in your update to see whether the player’s 2D coordinates match that of your game object.
Update()
if (transform.position.x == player.transform.position.x &&
transform.position.z == player.transform.position.z)
{
//Do some thing
}
Something like that would work.
If you don’t want to use collision you could perform a distance check.
if (Vector3.Distance(player.position, other.position) <= 0.1f)
DoTheThing();