- Home /
Find if any gameObject exists in an exact Vector3?
Hello, I'm working on a game that has an in game level editor and all object locations are rounded to the nearest one before being placed down meaning every Vector3 is not a series float but actually a series of integers, all I want to do is check if any type of game object exists in a precise location, for example. I already have something that does this in a script with a raycast and I want to do something like this but with a preset Vector3 variable that I created manually.
I want to do something like "hit.transform.gameObject" does, except using a Vector3 I have created. I found a few questions like this and the responses where mostly "Vectors are floats and not integers, so 1 is not equal to 1.1, this won't work, use a trigger!" I understand this well, but in my situation Vectors are integers. So this doesn't really apply. This is a really basic question and I'd love if someone where to give a simple easy answer with a link to the Unity scripting reference or a simple example code.
By the way, I'm using C#. Please no JavaScript.