Find GameObject at position

In my game, I’m trying to make a script where it sees if another GameObject is in the same position as the GameObject with the script. Any ideas?

You could either: Loop through all GameObject.FindObjectsOfType() and check their position (slow), or use a Physics.SphereCast() on the position and find all objects there (requires them to have colliders).

You can use Physics.OverlapSphere which will return you call of the colliders whose bounding volumes collide with the object. Example radius is 1, adjust as necessary.

  Collider[] colliders;
  if((colliders = Physics.OverlapShere(transform.position, 1f /* Radius */)).Length > 1) //Presuming the object you are testing also has a collider 0 otherwise
       foreach(var collider in colliders)
            var go = collider.gameObject; //This is the game object you collided with
            if(go == gameObject) continue; //Skip the object itself
            //Do something

or using linq

    using System.Linq;

    var collidedGameObjects = 
         Physics.OverlapSphere(transform.position, 1 /*Radius*/)
         .Except(new [] {collider})

var myPosition:Vector3;
var otherObject:GameObject;

function update(){

 myPosition = transform.position;
 theOtherPosition = otherGameObject.transform.position;

 if(myPosition == theOtherPosition){


Looks like there’s a 2D equivalent.
I haven’t used it yet, but I’m about to give it a try.