Create Location-Based AR Quickly and Easily (Unity + Lightship WPS)

  Рет қаралды 4,241

Alive Studios

Alive Studios

Күн бұрын

Пікірлер: 41
@AliveStudios_
@AliveStudios_ 7 ай бұрын
IMPORTANT ADDITION: 👉🏽 If you want to build location based experiences that are more accurate and use actual 3D scans, take a look at my VPS tutorial: kzbin.info/www/bejne/pWKol6trZ9mXqbcsi=HxW-hiLm5g6q_73M 👉🏽 For the seconds part, letting the user place the objects, you can also use the ARWorldPositioningCameraHelper to make your life easier. It will let you automatically access the current GPS coordinates of your camera. The ARWorldPositioningCameraHelper is being automatically attached in play mode to your camera under XR origin when using Lightship WPS . You can simply create a reference to it and then use the latitude and longitudes values from the ARWorldPositioningCameraHelper to spawn the objects. The whole script could look like this: using System.Collections; using System.Collections.Generic; using UnityEngine; using Niantic.Experimental.Lightship.AR.WorldPositioning; using Niantic.Experimental.Lightship.AR.XRSubsystems; using UnityEngine.UI; public class AddWPSObjects : MonoBehaviour { [SerializeField] ARWorldPositioningObjectHelper positioningHelper; [SerializeField] private ARWorldPositioningManager _positioningManager; [SerializeField] private Button button; //Add some random materials [SerializeField] private List cubeMaterials; //Reference the helper private ARWorldPositioningCameraHelper _arWorldPositioningCameraHelper; void Start() { //Find the helper in the scene _arWorldPositioningCameraHelper = FindObjectOfType(); button.onClick.AddListener(SpawnObjectAtPosition); _positioningManager.OnStatusChanged += OnStatusChanged; } private void OnStatusChanged(WorldPositioningStatus obj) { Debug.Log("WPS Status Changed " + obj); } void SpawnObjectAtPosition() { //Use it to determine the GPS position double latitude =_arWorldPositioningCameraHelper.Latitude; double longitude = _arWorldPositioningCameraHelper.Longitude; double altitude = 0.0; GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); cube.GetComponent().material = cubeMaterials[Random.Range(0, cubeMaterials.Count-1)]; cube.transform.localScale *= .75f; positioningHelper.AddOrUpdateObject(cube, latitude, longitude, altitude, Quaternion.identity); Debug.Log("Placing Object at: latitude:" + latitude + " longitude: " + longitude); } } 👉🏻 The WPS package is now out of experimental with ARDK 3.9. It is now included with the standard package of lightship. The namespaces should also be a bit different and no longer experimental. Otherwise it should stay the same though.
@justapasserby445
@justapasserby445 7 ай бұрын
tq bro
@svs4662
@svs4662 2 ай бұрын
Truly thank you for your tutorial.. My only issue would be that I got stuck after finishing the first script since the element WPS did not enable anything after finishing writing the Script.. it was there, but blocked, like if the script was not updated(writen inside) would be truly helpful to know how to solve this... and again, really thank you for the amazing work.
@virtualcity365
@virtualcity365 2 ай бұрын
Hello, first of all, I want to say that your tutorial is really great and it helped solve my confusion about positioning objects with the ARDK tool. However, I have a further question: how can I adjust or set an object to be placed exactly on the roof of a building? Since users who are experiencing it might not always be standing on the ground-they could be at different heights or angles. Is there a more intuitive way to position objects accurately in the right spot to better match the user's perspective? Thank you!
@AliveStudios_
@AliveStudios_ 2 ай бұрын
So on a rooftop, maybe the Google Geospatial API might be the right thing for you. It allows you to use Google maps for positioning Objects in AR. developers.google.com/ar/geospatialcreator/unity I did try it out a couple of times, however I have to say that it seems to be a bit dated and I also couldn't get it to work on iOS. Otherwise there is VPS which requires that a specific building or area has been pre-scanned. I made a tutorial on that here: kzbin.info/www/bejne/pWKol6trZ9mXqbcsi=HxW-hiLm5g6q_73M
@tomtomtomd
@tomtomtomd Ай бұрын
Hi I have a question. When adding package from a git URL, I get an error so I cannot install lightship. can you please help me with that?
@AliveStudios_
@AliveStudios_ Ай бұрын
Sure :) did you use the correct link from the documentation? lightship.dev/docs/ardk/setup/
@RoRo-rg2vr
@RoRo-rg2vr 5 ай бұрын
Assets\PreplaceWorldObjects.cs(36,34): error CS0246: The type or namespace name 'ARWorldPositioningStatus' could not be found (are you missing a using directive or an assembly reference?) I have this error when i try implementing the first script. WHat could be the cause
@AliveStudios_
@AliveStudios_ 5 ай бұрын
Did you make sure that the WPS package (04:00) was successfully installed?
@miukatou
@miukatou 2 ай бұрын
Hello, sir. Thank you for your tutorial. It has been very helpful for my personal project. However, I am stuck at the 15 minute and 52 second mark in the video. Here I am showing some issues. I did complete every step of your tutorial for the first 15 minutes, but I cannot see my model. I am not sure what the error means? Can you answer it? I will be very grateful! [Log] : Started up logging. (Log] : Status changed to Initializing [Warning] : [Warning) [2024-10-04 20:33:30.388] [0x208c4fec0] Userld is missing. Please set a unique Id using PrivacyData. Userld for data management purposes. (Please see documentation for more details (Log] : Status changed to TrackingFailed [Log] : Status changed to NoGnss [Log] : Status changed to Available
@aarongreen4432
@aarongreen4432 7 ай бұрын
So i tried this and added the zlog as nothing was appearing, I've checked all the permissions etc, but im getting the error no tracking and no gnss. Any ideas?
@AliveStudios_
@AliveStudios_ 6 ай бұрын
hmm, so if you made sure that you have a good 4G / 5G on your phone it should usually work. Is there any way you can try this on another phone and see if you got the same error?
@myrxs6427
@myrxs6427 2 ай бұрын
can we used this for webAR development?
@AliveStudios_
@AliveStudios_ 2 ай бұрын
At the current moment unfortunately not
@krlosconk
@krlosconk 3 ай бұрын
how could i possibly make the player be able to "collect" the pre placed objects?
@AliveStudios_
@AliveStudios_ 3 ай бұрын
You could for example implement a logic to deactivate the gameobject on click and add it to your inventory. I actually have a Unity asset that already does this (which is a paid asset though) : kzbin.info/www/bejne/q2aZnq2DpbWJrcUsi=H9RaAzn7WPJ0OMN-
@krlosconk
@krlosconk 3 ай бұрын
@@AliveStudios_ i have seen it, unfortunately i cant afford to buy it for the project im working on. Could you maybe tell me how to look up this logic?, thank you anyways
@adamabdulrazak761
@adamabdulrazak761 4 ай бұрын
do you think its possible to do this with 3D models of an object of a real world object but have the camera view correct the placement of the object? the gps location is not accurate enough, so i get misaligned objects with its real world counterpart a lot. i was thinking of using openCV edge and corner detection to identify real objects and line it up with the 3d object.let me know what you think,
@AliveStudios_
@AliveStudios_ 4 ай бұрын
Yes, I think what you are referring to is already implemented in the VPS system from Lightship ARDK. Made a tutorial in that too: kzbin.info/www/bejne/pWKol6trZ9mXqbcsi=JbWPF4peE3wkdOjS
@adamabdulrazak761
@adamabdulrazak761 4 ай бұрын
@@AliveStudios_ yes thank you for the rpely i saw the video after posting my comment. I am thinking if niantic VPS can cover a whole building or not as I am tryingot implement a digitl twin of it and have accurate alignment from 360 degree angle of the building. will give it a shot but it seems niantic VPS is more focused onto smaller objects
@flyingulat7967
@flyingulat7967 3 ай бұрын
could i possibly build this on windows pc and run it on ios phone without using virtual machine for macos?
@AliveStudios_
@AliveStudios_ 3 ай бұрын
Hi mate, sadly it is currently not possible to build from windows to iOS. The best option I found when researching was this: assetstore.unity.com/packages/tools/utilities/ios-project-builder-for-windows-15522 I don't know if this actually works though.
@flyingulat7967
@flyingulat7967 3 ай бұрын
@@AliveStudios_ Thanks for the reply! I still have 2 more doubts since its my first time building an AR project. 1. should i be concerned about this warning that pops up in my console: Package Lightship World Positioning System (WPS) Plugin has no loader metadata. Skipping loader initialization. UnityEditor.EditorApplication:Internal_PlayModeStateChanged (UnityEditor.PlayModeStateChange) 2. once i have all things set up, how do i get the project to run on my android device after i click build and run? like do I just have to connect my laptop to my android device via usb and the project would just appear? Hope i could get some clarification on this. thank you so much for the great help :)
@ΑναστασιαΡ-ζ5φ
@ΑναστασιαΡ-ζ5φ 5 ай бұрын
Thanks for the tutorial! I tried this, but only the second script works properly. I want to pre-place some objects though. I have no errors, but the objects still don't appear on the device. However, when I playtest in Unity, the debug.log statements seem to work well (Placing object at longitude X and latitude Y appear). A bit late, but any suggestions?
@AliveStudios_
@AliveStudios_ 5 ай бұрын
Hi mate :) So if I get you right, pre-placing objects does not work for you, because the 3D Objects do not appear at their corresponding positions on device? Did you make sure to set in the Camera settings 14:08 the clipping plane option to 500, or even better something like 10.000 ?
@ΑναστασιαΡ-ζ5φ
@ΑναστασιαΡ-ζ5φ 5 ай бұрын
@@AliveStudios_ Hi, thanks for taking the time to reply! I had already set the clipping planes to 10000. My problem is that I am not sure if the loop that spawns the object actually works, because on the android device, the only log that appears is the: Status changed to available. When I run the game on Unity however, the game window shows the following logs: -Status changed to initializing. -[Warning] Package “Lightship World Positioning System (WPS) Plugin" has no loader metadata. Skipping loader initialization. (I saw on the site for ARDK 3.6 Release notes that this error is benign and can be ignored, so I am not sure if that’s the issue). However, in the editor window in Unity, the following debug statements appear: -Added object at latitude X and longitude Y. -Status changed to initializing. -Plugin Lightship World Positioning System (WPS) Plugin" has no loader metadata. Skipping loader initialization.
@AliveStudios_
@AliveStudios_ 5 ай бұрын
​@@ΑναστασιαΡ-ζ5φ So that means the Debug statement with the added object at latitude X etc. does not appear on your android device.. Is there by any chance another device (e.g. from a friend) that you could test this on? You can try to create a clean build under build setttings -> on the little arrow next to build -> clean build. Maybe this will help. Our first goal should be to get the log statement working on device. Did you also try to set the object at your immediate location, so that you could see them if they were there? Then also make sure that the occlusion manager which we added at 14:10 is turned of / disabled.
@sakanfar
@sakanfar 4 ай бұрын
when i open the app the camera stay black screen ?, why
@AliveStudios_
@AliveStudios_ 4 ай бұрын
Maybe because you are using URP as a render pipeline? I made a tutorial on using lightship / ar foundation with urp here kzbin.info/www/bejne/fH2xdpKQrK-fj7c
@sakanfar
@sakanfar 4 ай бұрын
@@AliveStudios_ thnx
@justapasserby445
@justapasserby445 7 ай бұрын
Hi sir sorry for bothering may I know how to set the aspect ratio into iphone? because I search google I just cant search it....
@AliveStudios_
@AliveStudios_ 7 ай бұрын
Hey mate :) It is not necessary to set it to iPhone, you can also set it to any android phone you like :). Most likely you do not see iPhone as your build target is set to Android
@justapasserby445
@justapasserby445 7 ай бұрын
@@AliveStudios_ but I have non 😓.. I install unity and I have non of it😓
@AliveStudios_
@AliveStudios_ 7 ай бұрын
@@justapasserby445 When you click on file (top right) build settings , do you see android or iOS being selected?
@justapasserby445
@justapasserby445 7 ай бұрын
@@AliveStudios_ yea I select android in the build settings but I didnt saw any option for me to choose any android phone. its a SDK right? but I saw nothing. I saw run device, default device.
@justapasserby445
@justapasserby445 7 ай бұрын
@@AliveStudios_ at 3:53 I saw you have a lots of selection but for me I have non of android and iphone at all, I search google but google didnt have the answer..
@raizel420
@raizel420 7 ай бұрын
is it possible to create a game using your tutorial in tiktok effect house?
@AliveStudios_
@AliveStudios_ 7 ай бұрын
Hey :) So this Tutorial can be used to create a standalone game for the play store or App Store, which you could probably advertise on your TikTok account . While it is also possible to create games in effect house , as far as I am concerned, it is not possible to create AR games.
@raizel420
@raizel420 7 ай бұрын
@@AliveStudios_ thanks
How to build AR Apps fast (Unity + Lightship Samples)
15:27
Alive Studios
Рет қаралды 1,3 М.
How to make an AR Game in Unity (Beginner Friendly Tutorial)
1:17:58
Alive Studios
Рет қаралды 1,7 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Unity GPS AR - Get the Location
17:17
lightsandclockwork
Рет қаралды 1,8 М.
I’m making an AR Game (Devlog 1)
18:53
Alive Studios
Рет қаралды 1,6 М.
Make an AR game multiplayer with ConjureKit part 1
10:59
Auki - The DePIN for AI perception.
Рет қаралды 823
Root Motion + NavMeshAgent (and Nav Mesh Links!) | Unity Tutorial
23:38
Game Development Beyond the Basics
Рет қаралды 10 М.
Get started with Geospatial Creator in Unity
15:21
Google AR & VR
Рет қаралды 33 М.
Spatial Anchor - Mixed Reality Unity XR Tutorial
19:05
Valem Tutorials
Рет қаралды 17 М.
Step-By-Step Guide: Mapping My YouTube Studio With Immersal AR
19:45
Dilmer Valecillos
Рет қаралды 7 М.
My AR Game got Multiplayer! (and much more)
7:19
Alive Studios
Рет қаралды 1,5 М.
1ST AND 3RD PERSON CONTROLLER - COMPLETE COURSE
26:11
spaderdabomb
Рет қаралды 21 М.
Can AR become mainstream or might it "fail" ?
19:03
Alive Studios
Рет қаралды 216
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН