No video

Unity Mobile GPS - Real World Location - Unity 3D [Tutorial]

  Рет қаралды 130,812

N3K EN

N3K EN

Күн бұрын

In this video, we look at how to use the GPS and we simply display our real world location on the screen.
This example will show you how to launch the GPS Service and also show you how to use it from anywhere in your code
►-------------------------------------------------------◄
Join the community, keep on learning.
► Come hang out in discord! This is the most efficient way to reach not only the team members but thousands of other developers like you! We love it when you help, showcase or just discuss with each other in discord!
/ discord
► Learn about unity and game design with this playlist:
goo.gl/I04s9S
► If you enjoy what I do here and would like to support me, pledge any amount on Patreon.
www.patreon.co...
►-------------------------------------------------------◄
Stay up to date!
N3K is friendly, laidback community that helps you create video games, and make friends while doing so. Check out our website to learn more, or join us on discord!
n3k.ca
► Keep up to date with our plans! Follow the Facebook page
/ n3ken
►-------------------------------------------------------◄
More content!
Do you need some ideas?
Try out our Unity Training playlist!
►Subway Surfer, mobile game: goo.gl/xZhC6T
►Glide, Mobile game Tutorial: goo.gl/45ycLc
►Multiplayer Checkers Tutorial: goo.gl/RjqPkR
►2.5D Platformer Tutorial (Noob friendly!): goo.gl/m2S3QH
►Unity Mobile Game (Roller Ball): goo.gl/x3gwun
►Endless Runner: goo.gl/JTjQO5
►Chess Game: goo.gl/8blshX
►Beginner : goo.gl/4DXx18
►Intermediate : goo.gl/jMHhvC
►Advanced : goo.gl/dvGIDT

Пікірлер: 202
@maximtheconqueror
@maximtheconqueror 7 жыл бұрын
I like this guy's style. he is not trying to be the classic silicon valley programmer.
@n3ken
@n3ken 7 жыл бұрын
I'm not serious enough to be one of these LOL
@luqmanidris4860
@luqmanidris4860 7 жыл бұрын
Would love to watch another version of this tutorial like you mention in the video about using google map API. Maybe a tutorial on how to implement it. Thank you
@LittleMissSyreid
@LittleMissSyreid 7 жыл бұрын
Luqman Idris Totally agree.
@elissitdesign
@elissitdesign 7 жыл бұрын
YES! Want want!
@nacerkasbaji6887
@nacerkasbaji6887 6 жыл бұрын
yes please
@knowthyself4609
@knowthyself4609 5 жыл бұрын
@N3K EN #N3KEN
@justinrivera7800
@justinrivera7800 4 жыл бұрын
For everyone who's stuck at 0 make sure you allow permission on your phone to use the GPS: private void Awake() { if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { Permission.RequestUserPermission(Permission.FineLocation); } } That does the trick for Android Users IOS might be similar who knows?
@vampirevenem
@vampirevenem 4 жыл бұрын
Hey Justin, In which script shall i use this code? I tried it in all the 3, it's giving me the error saying "The name 'Permission' does not exist in the current context". Please do share your github repo link here if u can
@parthshukla1798
@parthshukla1798 4 жыл бұрын
@@vampirevenem put it in the GPS script after void Start and before private IEnumerator
@crosscreations_de
@crosscreations_de 3 жыл бұрын
@@vampirevenem For me, it worked to just allow my app in the GPS settings to read them. Afaik you will not be asked for permission if you not ask for it in the manifest.json file. So you have to do it manually. It also works with fake-gps apps (dev-mode required)
@vampirevenem
@vampirevenem 3 жыл бұрын
@@parthshukla1798 Tried it, No luck
@vampirevenem
@vampirevenem 3 жыл бұрын
@@crosscreations_de I'm sorry, didn't get you. Could any one of you please take time to send me your github repo here. Need to solve this issue, working on a proj nearing a deadline. I request anyone who actually go the expected result from the above vid to post their repository here🙏🤞
@healsnails
@healsnails 7 жыл бұрын
I have been trying to work with the GPS all week and have only gotten it to work once! It all makes sense now!!! The unity documentation isn't the most detailed in relation to this. Thanks for the tut. Maybe something for the accelerometer and orientation sensors would be useful soon too, seems to be the last bit left to cover. Thanks for the quality videos.
@n3ken
@n3ken 7 жыл бұрын
Accelerometer is next!
@MsMAKAiMURA
@MsMAKAiMURA 6 жыл бұрын
For updating the lon and lat variables for every (lets say) 1 sec, I believe it is better to create an InvokeRepeating function inside the Start(). Awesome tutorial by the way keep it up!!!
@chintu844
@chintu844 7 жыл бұрын
this channel is HIGHLY under rated! also can you make a tut on how to make a puzzle game like candy crush saga?
@markgianturco5677
@markgianturco5677 7 жыл бұрын
This was really helpful, thanks. I would really like to see a tutorial on using this with a map, like you mentioned at the end of the video. cheers.
@BrunaSilva-zz9th
@BrunaSilva-zz9th 7 жыл бұрын
Mate every time i finish watching one of your videos i think " You fuc...ng little genius"! Love it dude! BIG THANKS!
@n3ken
@n3ken 7 жыл бұрын
Thanks for watching, Appreciate it man! ;3 have a great time on the channel! meanwhile if you can join us on discord: discordapp.com/invite/etX2zJB
@moogleion
@moogleion 7 жыл бұрын
Awesome tutorial! This taught me a lot. Since we are on the topic of mobile sensors, can you please do a tutorial on android step counter/pedometer and how to run it on the background? I think that this would be really great for health apps. Thanks for the tutorial again, love it!
@adamsonvispo7915
@adamsonvispo7915 7 жыл бұрын
WHAT! you are in Manila?!.. can you do a seminar or a workshop or something for us?! been waiting for ages to find someone who actually can thought us about real game development here in the Philippines.. :D
@poornapanda9112
@poornapanda9112 5 жыл бұрын
Can you please tell me how to display a 3D pointer in two given coordinates when user activate mobile camera ?
@FroddeB
@FroddeB 5 жыл бұрын
Works like a champ, great tutorial!
@os_alex_4126
@os_alex_4126 4 жыл бұрын
Огромное спасибо! Это то, что я искал. это оказало огромный вклад в мою дипломную работу. были проблемы, показывало только 0 вместо координат. в телефоне в настройках приложения разрешил доступ к приложению всегда. это решило мою проблему.
@bhushanpawar50
@bhushanpawar50 2 жыл бұрын
Is it also possible to get Locations from API response and render unity object at that location? Can you make a video on it?
@jackstudio1405
@jackstudio1405 9 ай бұрын
Thanks a lot for the video! It works, but i am wondering how to make it keeps updating the coordinates during run time? Do anyone know?
@ShiyaMoegin
@ShiyaMoegin 7 жыл бұрын
NullReferenceException: Object reference not set to an instance of an object System.Single.ToString () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Single.cs:241) UpdateGPSText.Update () (at Assets/UpdateGPSText.cs:12) What should I do? Please, help.
@ShiyaMoegin
@ShiyaMoegin 7 жыл бұрын
I solved it by myself, but The Text works once. I want to make it work eternally.
@edengamedevelopmentcentree8606
@edengamedevelopmentcentree8606 7 жыл бұрын
How did you fix it?
@mllelafortune
@mllelafortune 5 жыл бұрын
@@edengamedevelopmentcentree8606 The log error suggests that the Text gameobject was not dragged and dropped in the Text field. I suppose.
@joeyabarratigue5414
@joeyabarratigue5414 4 жыл бұрын
Thanks for this video, it helped me a low. But somehow the latitude and the longitude both shows 0 coordinates, I've already enable my GPS. What should I do?
@aimphazer1961
@aimphazer1961 4 жыл бұрын
im getting 0 0 as well any ideas why?
@jobinedd2706
@jobinedd2706 3 жыл бұрын
I have the same issue. But in the first try I got the correct coordinates but then after adding the environments so that may chracter can navigate it results to 0, 0. Ive done some research still i cant fix it. Im using unity 2020
@Asta_Dena
@Asta_Dena 7 жыл бұрын
Is there a way to get a steady update of the gps coordinates? At my device the coordinates are only updated once on start of the app and then they never change. Even if i walk 100 meter.
@brunopicc
@brunopicc 7 жыл бұрын
Hey, i am with the same problem here. Did you figured out how to fix?
@kaasu9327
@kaasu9327 7 жыл бұрын
u need to add the following lines in the update function() latitude = Input.location.lastData.latitude; longitude = Input.location.lastData.longitude;
@winsonyu9637
@winsonyu9637 7 жыл бұрын
In the tutorial he removed the void Update() function in GPS script. Are we suppose to add that back in with this 2 lines of code?
@redxblood85
@redxblood85 6 жыл бұрын
is there a way to make it update faster?
@madhurmarskole5687
@madhurmarskole5687 6 жыл бұрын
kaarthick subramanian for me it doesn't worked
@steliosneophytides7060
@steliosneophytides7060 3 жыл бұрын
Hey man, do you know how to use this coordinates to place there a fbx model?
@JohnDoe-fv5cu
@JohnDoe-fv5cu 7 жыл бұрын
Another great tut! Thank you very much for sharing this :)
@enzoms6643
@enzoms6643 7 жыл бұрын
Nice tutorial 10/10
@n3ken
@n3ken 7 жыл бұрын
nice comment 11/10
@shwetajobanputra4827
@shwetajobanputra4827 4 жыл бұрын
Liked the tutorial, as you have mentioned would like to see tutorial on google maps. Also i want to ask if is there google api which helps to check the distance of my device from any road.? Any suggestion would be great Thanks
@ravdeepkour5356
@ravdeepkour5356 3 жыл бұрын
Nice one! My lat and Long are hidden behind canvas. Can't see them in the scene.
@unitypro
@unitypro 7 жыл бұрын
This has been mega helpful. It lead me to another problem though. I've been struggling with for ages. I detected my GPS and loaded in the long lat coordinates of another location 25 metres away. I want to spawn an object in the world based on the distance from the two coordinates and translated into the unity world AR environment. Kind of like making the red circle appear 20 metres away from my current GPS with an arrow pointing in the direction I should walk. I've detected the distance in metres from the two coordinates and have that on screen. I updated the GPS to update the distance live as I walk. Now I'm stuck, it's the last part of the idea I have. Can you help?
@DimitarUzunov1412
@DimitarUzunov1412 7 жыл бұрын
Thanks for the tutorial. Unfortunately, my app crashes upon launch. After researching I found that the location service bugs if you are using Unity version 5.5 or higher. Which version are you using in this tutorial?
@enzoms6643
@enzoms6643 7 жыл бұрын
You can do a tutorial in which you walk along the street and show information images in different cordenada, such as street names, business etc
@feckingegg9146
@feckingegg9146 6 жыл бұрын
Could you show us how to make a location based minimap?
@adityanugraha2709
@adityanugraha2709 3 жыл бұрын
Hi, I follow your tutorial and encounter this problem Assets\Script\UpdateGPSText.cs(12,41): error CS0117: 'GPS' does not contain a definition for 'Instance' what should I do?
@madhurmarskole5687
@madhurmarskole5687 6 жыл бұрын
I want to know how to change values of latitude and longitude runtime because once I start my app the values are constant whether I walk 100 metres it doesn't change
@jenniferanneipsen6253
@jenniferanneipsen6253 6 жыл бұрын
It wasn't meant to update. Try this: stackoverflow.com/questions/41783288/auto-updating-gps-location
@madhurmarskole5687
@madhurmarskole5687 6 жыл бұрын
@JennTerra thanks buddy
@user-xn2jn8tt3b
@user-xn2jn8tt3b 7 жыл бұрын
Большое спасибо за видео. Очень понятно несмотря на то, что я не знаю английского языка! ) Thank you very much for the video. Very clear despite the fact that I don't know the English language
@avcomplex
@avcomplex 6 жыл бұрын
I have the same problem as Asta D. The coordinates only update once we start the app, and won't keep updating while moving around
@Kapacs
@Kapacs 3 жыл бұрын
Had the same problem recently. The solution is to go into the GPS.cs script and take out latitude = Input.location.lastData.latitude; and the longitude from where he wrote them and move these allocations to a separate function. After that go into the Start() function and don't change anything, just add a InvokeRepeating("Function name", 1, 5); to check every 5 seconds for new coordinates. Replace Function name with the new function you created. It works for me like that.
@gooddereklu
@gooddereklu 5 жыл бұрын
Hi! I saw this on Unity official website as well, wondering whether it must took like 20 seconds to finish initialization? or can it be faster?
@tolik3823
@tolik3823 7 жыл бұрын
Thanks! Waiting for accelerometer :)
@n3ken
@n3ken 7 жыл бұрын
Coming up next!
@naayexperienciasinteractiv1447
@naayexperienciasinteractiv1447 5 жыл бұрын
Do you think its possible to get the direction of where you're looking at? Lets say, I'm on certain location and want to place a 3d object when looking at a certain direction.
@Avi3ator
@Avi3ator 7 жыл бұрын
How can i make so i get the location from a transmitter? I want to get the location of the transmitter to my iphone
@joebonds3072
@joebonds3072 2 ай бұрын
Does anyone have a more accurate way to get the GPS location in Unity? Doing it this way is only accurate up to 10 meters using Network location, not GPS location. Also, so it works with Android 14 as well.
@Error-pb6ee
@Error-pb6ee 5 жыл бұрын
hey guy how can i use these coords to move my camera?
@abinayasumathi1147
@abinayasumathi1147 5 жыл бұрын
Wonderful can you explain about the compass?
@levtunik997
@levtunik997 4 жыл бұрын
it always returns "user has not enabled GPS", but my GPS is On. another strange thing is that on your last tutorial with the Camera, I got a Permissions request for the camera, but this time i didnt receive such a request..can anyone assist?
@JoaoSilva-hq2is
@JoaoSilva-hq2is 7 жыл бұрын
Hello, can someone give me some help. I have followed the script by the "book" but my location shows Lat:0 and Long:0 all the time. Has anyone else had the same issue?
@JoaoSilva-hq2is
@JoaoSilva-hq2is 7 жыл бұрын
That´s ok sorted!
@natalieieyoub2543
@natalieieyoub2543 7 жыл бұрын
i have the same issue, how did u fix it?
@n3ken
@n3ken 7 жыл бұрын
hey Natalie, can you elaborate more here: discordapp.com/invite/etX2zJB under #programming_help? thanks! ;3
@chuganator
@chuganator 6 жыл бұрын
Ya tell us how you fixed it?
@kristoffergalicha7830
@kristoffergalicha7830 6 жыл бұрын
cant find on android player settings.
@Justicefu
@Justicefu 4 жыл бұрын
your tutorials are good but god damn that hard G on gyroscope really hits the ear wrong :P
@kitz3612
@kitz3612 5 жыл бұрын
I just subscribed to your channel Awesome tutorial. But how can i get the accurate location? And If I'm able to put some text when his/her location changed.
@1412dante
@1412dante 6 жыл бұрын
the GPS code works well for me but somehow i cant access the camera, gonna figure it out again and thanks a lot!
@armandolopez7066
@armandolopez7066 7 жыл бұрын
hi man ... how are you?... i can put any information over map?... example: a place and display a icon or a journey in color???
@harmeetbawa1386
@harmeetbawa1386 7 жыл бұрын
Could you please tell me how could i use wifi distance to map my distance to make my player move towards a marker?
@framex_media
@framex_media 6 жыл бұрын
Thank you! Great tut!
@emil5633
@emil5633 4 жыл бұрын
Anyone knows how to check the radius around the user to find an object with coordinate? Let's say I set an object at a specific coordinate and I want it to check if it is within the radius of the user. How do I do that, once I get the user's coordinate?
@arkamajhi
@arkamajhi 5 жыл бұрын
How to ask permission for location later in other scenes. People usually don't allow these services if prompted at the beginning.
@shailablamichhane7677
@shailablamichhane7677 7 жыл бұрын
Hey. In my area internet connection is needed to use the location service. So can u help me ? I mean how to use internet to get location ?
@Jeredriq
@Jeredriq 4 жыл бұрын
It stays 0 :(
@parthshukla1798
@parthshukla1798 4 жыл бұрын
For everyone who's stuck at 0 make sure you allow permission on your phone to use the GPS: private void Awake() { if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { Permission.RequestUserPermission(Permission.FineLocation); } }
@k4chanzs427
@k4chanzs427 5 жыл бұрын
How to move a 3d object in unity world while walking around with android phone. i 'v been working on it for a week but cannot able to find exact solution.
@samueljimenez5816
@samueljimenez5816 6 жыл бұрын
Thanks for the video.
@michellefernandes2065
@michellefernandes2065 6 жыл бұрын
Hey! Is there some way to make the app show 3d models in specifics places of the real world ( specific coordenates of latitude/longitude) ? Can you help me?
@siyuli5743
@siyuli5743 4 жыл бұрын
Hi did you get a solution? I am struggling with it right now.
@jameslila1852
@jameslila1852 4 жыл бұрын
@@siyuli5743 mee to
@zadeh79
@zadeh79 2 жыл бұрын
Mine keeps reading 0 for Latitude and 0 for Longitude.
@chetanmrane
@chetanmrane 7 жыл бұрын
very helpful tutorial
@n3ken
@n3ken 7 жыл бұрын
Glad it helped!
@subramanyam2699
@subramanyam2699 6 жыл бұрын
Cool I was looking for this..
@rahulmahajan6902
@rahulmahajan6902 7 жыл бұрын
thanks for helping us .....
@n3ken
@n3ken 7 жыл бұрын
Thanks for the continuous support!
@jayatemara2434
@jayatemara2434 7 жыл бұрын
Nice tutorial. But I have a question How to converts GPS Location to Unity World position?
@DavidKyokushin
@DavidKyokushin 7 жыл бұрын
It really depends how you want to build your game. Unless you have a map API system ready. I'd suggest you set the location from the initial call as your 0,0 in unity. And then move relatively to this position.
@JMMedinaDev
@JMMedinaDev 5 жыл бұрын
@@DavidKyokushin Thats not a good aproach at all, GPS coordinate is a sphere coordinate system while unity is a triplanar cartesian reference. There is not a shortway to deal with it, there is some aproach but even the strongest developers teams are struggling with that.
@jameslila1852
@jameslila1852 4 жыл бұрын
@@JMMedinaDev hi mate. Do you have any idea on how to put google map in unity and use this GPS locator?
@JMMedinaDev
@JMMedinaDev 4 жыл бұрын
@@jameslila1852 you need Google's dev validation yo use the Google Maps API for Unity. There is better options, like mapbox.
@jameslila1852
@jameslila1852 4 жыл бұрын
@@JMMedinaDev where can i contact you mate?
@alinawaz4034
@alinawaz4034 7 жыл бұрын
nice tutorial man
@n3ken
@n3ken 7 жыл бұрын
+Ali Nawaz thanks !
@tahani-xo4io
@tahani-xo4io 6 жыл бұрын
can i use this in a navigation system or there is a better way?
@davidarguedas5735
@davidarguedas5735 5 жыл бұрын
Do you need unity pro to connect to some appis like google?
@MB-ko3mn
@MB-ko3mn 7 жыл бұрын
Hi, Thanks for the tutorial, Awesome :) Do you know how we can set our object in a specific location (Coordinates) instead of fixed distance from cam?
@iliasmourtos9817
@iliasmourtos9817 5 жыл бұрын
Hi , I m working on unity project using ARcore did you find a solution to your problem ?
@lestrike2707
@lestrike2707 3 жыл бұрын
this doesn't work for me sadly. The Nexus 5 I am testing this on always times out
@mohamadalsioufi6993
@mohamadalsioufi6993 7 жыл бұрын
You are AMAZING !
@ecarttop6955
@ecarttop6955 Жыл бұрын
Great vidro
@romeotan2
@romeotan2 6 жыл бұрын
Hihi.....i've been searching for u!!! :) i really need people like u with such knowledge. Possible to contact u?
@web3.0_metaverse_XR
@web3.0_metaverse_XR 7 жыл бұрын
Hi thank you for this video.can you guide me on how to get other device gps locations on our device ?
@n3ken
@n3ken 7 жыл бұрын
Hey RootFinder, talk to me here: discordapp.com/invite/etX2zJB under #programming_help
@mynameartthememory626
@mynameartthememory626 6 жыл бұрын
i can use this for walking in game ?
@robcarlton2341
@robcarlton2341 5 жыл бұрын
Could you maybe make a tut about mobile multiplayer
@jaina.mehta.m
@jaina.mehta.m 6 жыл бұрын
The debug log shows 'The user has not enabled the GPS'. The GPS is 'ON' in the phone and unity remote 5 also has the permission to use the location. Can some one please help where could I be going wrong?
@jenniferanneipsen6253
@jenniferanneipsen6253 6 жыл бұрын
I had this problem and I needed to enable GPS on the specific app.
@madhavgupta7108
@madhavgupta7108 7 жыл бұрын
are you aware of some way by which we can create geo-fences in unity?
@mohsenmokhtari6170
@mohsenmokhtari6170 6 жыл бұрын
is there any way to reduce accurate GPS to a meter?
@ramiroricardomaqueacuna5176
@ramiroricardomaqueacuna5176 5 жыл бұрын
How can I rsee others people location in unity?
@webmanie
@webmanie 2 жыл бұрын
Perfekt :-)
@justinwr092
@justinwr092 5 жыл бұрын
Is this device agnostic? Will it work on Android and iPhone?
@francuz314
@francuz314 6 жыл бұрын
hi. very good video, but not repeating in my project - write "GPS not enabled". why? (use desktop computer, not phone)
@rcoffman3491
@rcoffman3491 5 жыл бұрын
It won't work on a computer. Only on a mobile device. iOS or Android. Unity has no way to detect GPS on a computer.
@spritegeek5888
@spritegeek5888 7 жыл бұрын
i tried the same code in my project, but the service status does not change from Initializing but the same code works in another project. other people seem to have encountered the same issue but i haven't come across a solution
@spritegeek5888
@spritegeek5888 7 жыл бұрын
also, it does not time out
@NabilMajid
@NabilMajid 5 жыл бұрын
How can i put a 3D object in that coordinate?
@nicolaslorenzi855
@nicolaslorenzi855 3 жыл бұрын
Can I do it for rotation too?
@espheroz
@espheroz 7 жыл бұрын
it didnt work for me i get 0 for lat and long. i found out what is wrong with the code when i hear u about initializing at the end. and for anyone who got the same problem with me look into this part of the code on (gps script) while(Input.location.status == LocationServiceStatus.Initializing && maxWait > 0) check for misspeal or retype it can fix the problem
@n3ken
@n3ken 7 жыл бұрын
hello esp, will you post your code here: : discordapp.com/invite/etX2zJB under #programming_help so we can help you? thanks! ;3
@espheroz
@espheroz 7 жыл бұрын
i got it working actually, lol thank you for the thought
@boriszdero5437
@boriszdero5437 7 жыл бұрын
HOw did you get it working? I have the same problem!
@parthshukla1798
@parthshukla1798 4 жыл бұрын
For everyone who's stuck at 0 make sure you allow permission on your phone to use the GPS: If you are on Android: private void Awake() { if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { Permission.RequestUserPermission(Permission.FineLocation); } } Also add using UnityEngine.Android; in the start of the program this is in the GPS.cs script If you are on IoS: Go to Player settings in Unity and update your 'Location Usage Description'. 'NSLocationWhenInUseUsageDescription' field in App's info.plist file is required when location services are used (same for Camera & Microphone). You can add anything in the description, this will prompt the user to either accept or deny the use of location services.
@cullvox
@cullvox 7 жыл бұрын
I tried the code and I don't think that the tutorial works anymore.
@jeremiahtaylor8337
@jeremiahtaylor8337 6 жыл бұрын
worked for me
@havoc552
@havoc552 6 жыл бұрын
How would I go about repeating and updating the lat and long?
@jenniferanneipsen6253
@jenniferanneipsen6253 6 жыл бұрын
Try this: stackoverflow.com/questions/41783288/auto-updating-gps-location
@aitizazulhassansyed9778
@aitizazulhassansyed9778 7 жыл бұрын
can you help me my application is crashing after 1 minute??
@prodbylink2514
@prodbylink2514 5 жыл бұрын
Anyone else's lat and long give them a value of 0?
@rutabaamin4690
@rutabaamin4690 5 жыл бұрын
getting the same problem. did you find the solution?
@rutabaamin4690
@rutabaamin4690 5 жыл бұрын
getting the same problem. did you find the solution?
@deathdied
@deathdied 4 жыл бұрын
@@rutabaamin4690 Maybe is a problem of localization. You must have some kind of Internet connection WiFi or SIM.
@parthshukla1798
@parthshukla1798 4 жыл бұрын
For everyone who's stuck at 0 make sure you allow permission on your phone to use the GPS: private void Awake() { if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { Permission.RequestUserPermission(Permission.FineLocation); } } Also add using UnityEngine.Android; in the start of the program this is in the GPS.cs script
@user-uf3hi8mj2z
@user-uf3hi8mj2z 7 жыл бұрын
i also have a problem some people has. in my device gps get the data just once. im searching but :( is there another guy solved this problem?
@n3ken
@n3ken 7 жыл бұрын
hey, 전성용 when you have the time explain more of the problem here: 전성용 under #programming_help and we will get back to you. thanks! ;3
@mohsenmokhtari6170
@mohsenmokhtari6170 6 жыл бұрын
how to get accurate location??? (use sensor android device)
@nielsvdmarel
@nielsvdmarel 7 жыл бұрын
it doesn't seem to work for me ....
@leoncepin588
@leoncepin588 7 жыл бұрын
THANK YOUUUUUUU
@migueltorresjr
@migueltorresjr 5 жыл бұрын
Always print lat and long value of 0 :(
@lesliegg23
@lesliegg23 5 жыл бұрын
I'm having the same issue.
@chericherilxdy
@chericherilxdy 4 жыл бұрын
Me too, any solution? :(
@parthshukla1798
@parthshukla1798 4 жыл бұрын
For everyone who's stuck at 0 make sure you allow permission on your phone to use the GPS: private void Awake() { if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { Permission.RequestUserPermission(Permission.FineLocation); } }
@parthshukla1798
@parthshukla1798 4 жыл бұрын
Also add using UnityEngine.Android; this is in the GPS.cs script
@iStory852
@iStory852 7 жыл бұрын
keep goin on
@brygidekmalowiejski7787
@brygidekmalowiejski7787 7 жыл бұрын
amazing :-)
@n3ken
@n3ken 7 жыл бұрын
Hello again my friend!
@sowelaar3531
@sowelaar3531 7 жыл бұрын
I followed the script exactly but I can only get Lat: 0 Long: 0 to display. Did anyone else have this problem/know where I went wrong?
@n3ken
@n3ken 7 жыл бұрын
hey if you have time post your script here: discordapp.com/invite/etX2zJB under #programming_help there should be people there to help you trouble shoot. thanks! ;3 enjoy the channel~
@sowelaar3531
@sowelaar3531 7 жыл бұрын
thanks for the reply, great videos
@showcaseone5061
@showcaseone5061 7 жыл бұрын
#MyLifeIsComplete Thanks for another great tutorial.
@alideveloper6945
@alideveloper6945 3 жыл бұрын
you should not give to everybody your exact coordinates
@jacewalton6677
@jacewalton6677 6 жыл бұрын
So you are in the Philippines is see....
@user-of8ck6ld6h
@user-of8ck6ld6h 4 жыл бұрын
you look like a Russian actor Daniil Vakhrushev (Даниил Вахрушев)
@ikergalardi5701
@ikergalardi5701 7 жыл бұрын
how long have you been programming in unity?
@n3ken
@n3ken 7 жыл бұрын
i think its my 4th year now
@carlogravador9690
@carlogravador9690 7 жыл бұрын
Can you post the unity file?
@byholaz
@byholaz 3 жыл бұрын
Ok. the scripts for app are 1"gps" using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Android; public class gps : MonoBehaviour { public static gps Instance { set; get; } public float latitude; public float longitude; private void Start() { Instance = this; DontDestroyOnLoad(gameObject); StartCoroutine(StartLocationService()); } private void Awake() { if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { Permission.RequestUserPermission(Permission.FineLocation); } } private IEnumerator StartLocationService() { if(!Input.location.isEnabledByUser) { Debug.Log("gps not active"); yield break; } Input.location.Start(); int maxWait = 20; while(Input.location.status == LocationServiceStatus.Initializing && maxWait > 0) { yield return new WaitForSeconds(1); maxWait--; } if(maxWait
@varshitratna9688
@varshitratna9688 7 жыл бұрын
dude i have published an app in playstore after learning from your videos. Beat My Score an annoyingly fun game where troll faces irritate us. can you please make a short video of it or include in one of ur videos. it will be soon in appstore
Device Camera - How to - Unity 3D [Tutorial]
14:11
N3K EN
Рет қаралды 189 М.
We made a REAL HOLOGRAM Desk like Tony Stark's!
23:57
Hacksmith Industries
Рет қаралды 7 МЛН
What will he say ? 😱 #smarthome #cleaning #homecleaning #gadgets
01:00
So Cute 🥰
00:17
dednahype
Рет қаралды 43 МЛН
The CUTEST flower girl on YouTube (2019-2024)
00:10
Hungry FAM
Рет қаралды 38 МЛН
Coding INDOOR NAVIGATION with A* Pathfinding
10:24
MatthewHallberg
Рет қаралды 186 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 709 М.
Unity AR+GPS Location - Web Editor
7:37
Unity AR GPS Location
Рет қаралды 74 М.
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 527 М.
The biggest lie in video games
15:18
AIA
Рет қаралды 1,8 МЛН
I Wish I Had Known This Before I Started Unity Game Development...
11:11
I Spent 100 HOURS Making a Game With NO GAME ENGINE
13:42
Fuelvin
Рет қаралды 339 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 4,7 МЛН