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.
@justapasserby4457 ай бұрын
tq bro
@svs46622 ай бұрын
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.
@virtualcity3652 ай бұрын
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_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Ай бұрын
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_Ай бұрын
Sure :) did you use the correct link from the documentation? lightship.dev/docs/ardk/setup/
@RoRo-rg2vr5 ай бұрын
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_5 ай бұрын
Did you make sure that the WPS package (04:00) was successfully installed?
@miukatou2 ай бұрын
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
@aarongreen44327 ай бұрын
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_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?
@myrxs64272 ай бұрын
can we used this for webAR development?
@AliveStudios_2 ай бұрын
At the current moment unfortunately not
@krlosconk3 ай бұрын
how could i possibly make the player be able to "collect" the pre placed objects?
@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-
@krlosconk3 ай бұрын
@@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
@adamabdulrazak7614 ай бұрын
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_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
@adamabdulrazak7614 ай бұрын
@@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
@flyingulat79673 ай бұрын
could i possibly build this on windows pc and run it on ios phone without using virtual machine for macos?
@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.
@flyingulat79673 ай бұрын
@@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 ай бұрын
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_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 ай бұрын
@@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_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.
@sakanfar4 ай бұрын
when i open the app the camera stay black screen ?, why
@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
@sakanfar4 ай бұрын
@@AliveStudios_ thnx
@justapasserby4457 ай бұрын
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_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
@justapasserby4457 ай бұрын
@@AliveStudios_ but I have non 😓.. I install unity and I have non of it😓
@AliveStudios_7 ай бұрын
@@justapasserby445 When you click on file (top right) build settings , do you see android or iOS being selected?
@justapasserby4457 ай бұрын
@@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.
@justapasserby4457 ай бұрын
@@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..
@raizel4207 ай бұрын
is it possible to create a game using your tutorial in tiktok effect house?
@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.