Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

how to find in game lat / long ?

how to find in game lat / long ? like howww and thanks. I already find the ( x , y z ) but its totally different ?

Product Version: Not Selected
more ▼

asked Jan 17 '17 at 06:01 AM in Blueprint Scripting

avatar image

3 1 3 4

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Hmm, basically you want to convert a Vec3 to polar coordinates. Assum r is the radius if your sphere and X,Y,Z the spacial coordiantes:

latitude = Acos( Y / r )

longitude = Atan(X / Y)


IE this image:

thetha is your latitude, phi the langitude

sphere.png (40.4 kB)
more ▼

answered Jan 17 '17 at 09:34 AM

avatar image

530 22 10 35

avatar image HadesKratos Jan 17 '17 at 10:05 AM

latitude = Acos( Y / r )

lets say x = 1 y = 2 z = 2 r = radius of Earth ?

so Cosine ( 2 / 6,371 ) ? is that right ? sorry im trying my best here :)

avatar image Speckulous Jan 17 '17 at 10:24 AM

I'm not sure if you know whats the difference between spacial coordinates and a lat/long system.

The earth is a sphere (lets say it's perfect round).

UE4 is a "flat" world by default, if you add a plane, it's just a plane, so you probably want to add a giant ball you can drive on. If you add this ball you can insert a radius somehow. If you are given this ball, and its middle point is (0,0,0), you can calculate the radius if you have ANY point on this ball, in your examle the radius is sqrt(1²+1²+2²) = 3.

If you are given some lat/long coords by your task somehow (your boss says he wants to drive that car through a town and you get the GPS dates in lon/lat) and you have this town in Unreal, but flat, not on a ball, you have to go the other way round (different formulars)

avatar image HadesKratos Jan 17 '17 at 11:09 AM

yup mine is the second option .Its a gps kind of thing that uses the lon/lat. Whats the other formula for that if i may ask ?

avatar image Speckulous Jan 17 '17 at 11:41 AM

x = r cos(lat) cos(lon)

y = r cos(lat) sin(lon)

z = r *sin(lat)

(I just googled them)

The Radius is about 6371km -> 637100000 in Unreal units, don't know if a float can handle this easily. I'm not even sure if you can handle gps with float, its not that precise

avatar image HadesKratos Jan 18 '17 at 10:33 AM

for now i just want the lat long to be done. THANK YOU VERY MUCH although my math is really not good . i need to make lat = something something and lot = something something for the formula

(comments are locked)
10|2000 characters needed characters left

There is no out-of-the-box feature for this. You would have to make one. You could use the X and Y coordinations for this and build your system based on it..

more ▼

answered Jan 17 '17 at 09:10 AM

avatar image

689 20 5 50

avatar image HadesKratos Jan 18 '17 at 10:07 AM

Thank you very much for your comment :)

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question