- Home /
Using real world coordinates in Unity ?
I was wondering if it's possible to have Unity check a the coordinates of where a person is standing in the real world so that if the person is in a specific spot or area around the spot it will display like a image or a video on the screen.
This would be done for mobile or iPad incase that makes any differences.
Answer by getyour411 · Sep 22, 2015 at 10:44 PM
I don't build on mobile but from other posts I've seen plenty of topics asked and answered about using native device APIs like GPS tracking which sounds like what you are after.
http://answers.unity3d.com/questions/344770/how-to-get-gps-coordinates-in-unity-3d.html
Search for other posts on that thread.
$$anonymous$$eep in $$anonymous$$d that GPS is not very accurate depending on how many satellites there are in range and what's their relative position. Sometimes it's very accurate (+- a few meters) sometimes it's extremely bad (+-100m or even worse).
It depends on for what purpose you need the position and what's your acceptable tolerance. Do you make some kind of Geocaching App?
Answer by verenion · Sep 22, 2015 at 11:12 AM
This isn't a very specific question.
If you are talking about some sort of trigger system, use a mesh collider with the OnCollisionEnter method : http://docs.unity3d.com/ScriptReference/Collider.OnCollisionEnter.html. When the player walks into the collider (make it a Trigger collider so that no collisions actually happen), you can do what you like.
Or for matching the location.
if (this.transform.position == otherTransformsPosition )
{
// Do anything you like
}