Is there a way I can check if there is a gsmeobject at a particular given position? I’m trying to figure out how to tell whether something is directly next to something else.
How about defining everything you want to be able to track the distance of by applying a tag to those game objects?
Once done, you can pick and space in the world, obtain a reference to each gameobject in the scene and then using Unity’s distance method, figure out which object is closest and exactly how far away it it.
If everything has colliders you could use Unity - Scripting API: Physics.OverlapSphere
1 Like