Beginners guide to UNITY AR Foundation (ARKit & ARCore) - Build your first AR app from scratch!

  Рет қаралды 75,382

Mohd Hamza

Mohd Hamza

Күн бұрын

This is my first Unity Tutorial video. I have used Unity AR Foundation to create an Augmented Reailty App from scratch.
Please note the package version combined with the editor version is very important. In this case, I'm using:
Unity 2020.1
AR Foundation 3.1.6
ARKit 3.1.8
ARCore 3.1.8
We'll be using a free Spider model from the Asset store: assetstore.uni...
The Placement Indicator art is used from Flaticon.com
AR Placement Script link: docs.google.co...
Buy me a coffee here: www.buymeacoff...
Discord server invite: / discord
Hit the like button if you like my work, comment if you have any feedback/suggestions. Subscribe for more content coming every week.

Пікірлер: 265
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi everyone, I have set up a Discord server, if anyone wishes to share media files of their project or any queries, use this link to connect: discord.gg/c7KWwsumEN ✌️
@gabrielboiciuc2517
@gabrielboiciuc2517 3 жыл бұрын
Hey. I try to make this app and transfer the apk on phone. But the phone s camera don t start. Can you help me? Please
@MohdHamza
@MohdHamza 3 жыл бұрын
@@gabrielboiciuc2517 Is your phone supported and in developer mode?
@drummsnikk5073
@drummsnikk5073 3 жыл бұрын
@@MohdHamza following this! I think i'm having the same problem :( What's the phone you used in the video/ you have? :) Thanks in advance
@MohdHamza
@MohdHamza 3 жыл бұрын
@@drummsnikk5073 Hi, its a google pixel 2. Have you got a supported device ?
@drummsnikk5073
@drummsnikk5073 3 жыл бұрын
@@MohdHamza Read the ARCore list few minutes ago.. seems I don't have a supported device... i'm desperate ahah
@timha7074
@timha7074 3 жыл бұрын
Your guide is still working for the newest Unity, AR Foundation and ARCore versions. First I had blackscreens too but its important that you are activating ARCore under project settings -> XR Pug-In Management ->ARCore Plugin.
@BrooklynJPakathi
@BrooklynJPakathi 3 жыл бұрын
i get this everytime - Manifest merger failed with multiple errors, see logs how to solve?
@humayun7062
@humayun7062 3 жыл бұрын
Thank you @Timha you saved my time
@edinailyes7325
@edinailyes7325 3 жыл бұрын
OMG.IT'S WORKING :))
@sawyergoetz1486
@sawyergoetz1486 3 жыл бұрын
Very helpful comment, this fixed my problem instantly!
@gabrielboiciuc2517
@gabrielboiciuc2517 3 жыл бұрын
Hello. I try to make this app and i have some problems. Can you help me?
@PhoenixPerryisawesome
@PhoenixPerryisawesome 3 жыл бұрын
HOLY BATMAN - this was so fast and easily 4 hours of content. Really great. I love tutorials this dense because you absoutely did not waste my time. I love you did this for someone who has an understanding of coding and unity. Thanks loads. More please!
@MohdHamza
@MohdHamza 3 жыл бұрын
Glad you liked it😊
@blackwhalestudio
@blackwhalestudio 2 жыл бұрын
For people in 2022 who have the "NullReferenceException: Object reference not set to an instance of an object" error in relation to the camera not being found: Try adding a Camera variable on top -> public Camera camera; and then assign it directly in the UpdatePlacementPose method -> var screenCenter = camera.ViewportToScreenPoint(new Vector3(0.5f, 0.5f)); This should fix the issue.
@ksupon9180
@ksupon9180 2 жыл бұрын
Thanks you!!
@fikretakcay3306
@fikretakcay3306 2 жыл бұрын
Thank you so much :)
@solomon6957
@solomon6957 Жыл бұрын
Sadly unity told that the camera variable is not assigned
@ArunGuni_
@ArunGuni_ 5 ай бұрын
@@solomon6957 is there any solution to that??
@somerandomguy3038
@somerandomguy3038 Жыл бұрын
Thank you brother. U literally just helped me to gain a perfect score in my Multimedia subject
@eneaminelli1500
@eneaminelli1500 Жыл бұрын
Great tutorial! You have been super clear, thank you.
@niamhdaly5758
@niamhdaly5758 3 жыл бұрын
THANK YOU!! I've been trying for weeks to get Unity & ARCore working together and I was on the verge of a full blown tantrum. You go pretty fast through some of the steps which I found a bit tricky, but I suppose it's better than waffling on and on like some other videos. Will be back for more :)
@MohdHamza
@MohdHamza 3 жыл бұрын
Glad it helped!
@levenzonderleven
@levenzonderleven 3 жыл бұрын
Don't forget to select ARCore or ARKit (depending on platform) in Project Settings -> XR Plugins
@Blessindisguise
@Blessindisguise 3 жыл бұрын
Whenever I do that (even with phone in developer mode etc) it doesn't build and run... If I unchecked it it will be just black screen or w.e. Is in the scene.
@xrmasiso
@xrmasiso 3 жыл бұрын
@@Blessindisguise sometimes the blackscreen is because you forgot to delete the main camera! i make tutorials too, come visit!
@muhammadsameer883
@muhammadsameer883 3 жыл бұрын
This is awesome. Straight to the point
@CrazyBalloonBoys
@CrazyBalloonBoys 3 жыл бұрын
NICE BROTHER HELPED ME ALOT
@JosephAli93
@JosephAli93 3 жыл бұрын
my friend you sounded more confident than most of my college teachers !!! 😭😂
@MumtazKhan-yn3mb
@MumtazKhan-yn3mb 3 жыл бұрын
Thanks for the video, awesome stuff!! Keep it up
@CODEDSOUNDS
@CODEDSOUNDS 3 жыл бұрын
I love this guys tutorials
@hnguyen5670
@hnguyen5670 3 жыл бұрын
I am creating AR and AR Portal for Unity. I liked your first video and subscribed. Keep up the good work.
@MohdHamza
@MohdHamza 3 жыл бұрын
Thank you very much! All the best with your project 👍🏻
@UllyanneFreire
@UllyanneFreire 2 жыл бұрын
thank you for this great and useful tutorial.
@UllyanneFreire
@UllyanneFreire 2 жыл бұрын
i made a couple of changes to be able to spawn multiple spiders and changed the camera from current to main too
@aguavirtual
@aguavirtual Жыл бұрын
Great tut bro!!! Thanks loads!!
@mtlight5997
@mtlight5997 3 жыл бұрын
Thanks Man ! Really helpful series !
@MohdHamza
@MohdHamza 3 жыл бұрын
Thanks for the appreciation!
@emintalhaark7806
@emintalhaark7806 3 жыл бұрын
Thanks for upload this video :)
@MohdHamza
@MohdHamza 3 жыл бұрын
Thanks for your appreciation!
@sefjo5223
@sefjo5223 3 жыл бұрын
NullReferenceException: Object reference not set to an instance of an object Had this error from this line: var screenCenter = Camera.current.ViewportToScreenPoint(new Vector3(0.5f, 0.5f)); I was trying to run your program on a laptop webcam. Any ideas on how to solve this?
@MohdHamza
@MohdHamza 3 жыл бұрын
This module shall work on ARCore and ARKit supported devices. Don’t think it will work elsewhere.
@kostikoglu95
@kostikoglu95 2 жыл бұрын
@@MohdHamza you haven't added a camera to the Controller. The script tries to access it though, resulting in a null error. You don't handle this in the video. Any suggestions?
@paulogarduque324
@paulogarduque324 3 жыл бұрын
Thank you so much, sir.. it is a big help for me as a beginner! it worked! kudos! God Bless! :D
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi Paulo, Great to hear that. Best of luck ahead!!
@paulogarduque324
@paulogarduque324 3 жыл бұрын
@@MohdHamza hello sir, can i ask if you have other projects that can I learn from?
@MohdHamza
@MohdHamza 3 жыл бұрын
@@paulogarduque324 At the moment you can follow the playlist. I haven’t uploaded any other projects on public platforms yet.
@paulogarduque324
@paulogarduque324 3 жыл бұрын
@@MohdHamza thank you so much sir :D
@andersonleao3413
@andersonleao3413 Жыл бұрын
Tanks man!!!!
@akshatakharade5702
@akshatakharade5702 3 жыл бұрын
Hi ..I follow all your guidelines. run it on Redmi note 7 pro device but it seems blank.
@anangbaral654
@anangbaral654 3 жыл бұрын
Good job buddy......excellent video..can you please help me that..how can i drag rotate or scale that 3d object ..
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi Anang, I have discussed scaling and rotating using sliders in this video: kzbin.info/www/bejne/amS7g56jdtKmma8 Scaling by touch is discussed here: kzbin.info/www/bejne/f4Sleqhsf9-ZoZo I haven’t built drag functions yet but will do so in the future.
@anangbaral654
@anangbaral654 3 жыл бұрын
Thank you ...but how to rotate and drag with finger touch on screen only
@BUdJohnson242
@BUdJohnson242 3 жыл бұрын
Awesome!!
@ModBass
@ModBass 3 жыл бұрын
I don't get the last instruction...when you click on AR Camera, first in the Inspector you see on AR Camera Manager the Auto Focus, Light Estimation and Facing Direction properties, but after that you click on "somewhere" and you see "Focus Mode" and "Light Estimation Mode"...how can I do that? Can you describe this passage? Thanks in advance!
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, Thanks for the comment. So this step can be skipped if you got the package versions correct while importing. The package versions I have written on screen as big white overlay text and also in the description box are the correct combination to use. I made a mistake while recording the video by downloading 4.1.1 versions of ARFoundation, ARKit and ARCore. So when I imported the correct version the focus mode and light estimaton had to be corrected. That's why I stressed on downloading the correct package version which I found out a bit later. Summary: If you stick with the package manager versions I mentioned in the description box you can use the default ARCamera gameobject without touching it and avoid doing what I did @14:29 Hope that helps✌️
@tab282001
@tab282001 3 жыл бұрын
Great content 👍🏻
@MohdHamza
@MohdHamza 3 жыл бұрын
Thanks 😊
@ohhhinc7770
@ohhhinc7770 3 жыл бұрын
Did you add the component "ARRaycastManager" to your arController? Otherwise this will not work. No?
@mikomiko171
@mikomiko171 3 жыл бұрын
Thanx, I am a beginner and I can follow you;-)
@sarathmadhu6569
@sarathmadhu6569 3 жыл бұрын
well done mate
@MohdHamza
@MohdHamza 3 жыл бұрын
Thank you :)
@DimTheGuitarist
@DimTheGuitarist 2 жыл бұрын
Amazing Tutorial! Totally helped me figure out ARCore basics. Any ideas on how to create an indicator on my screen, pointing to the AR Object position when I move my camera away from it??
@ameychavan70
@ameychavan70 2 жыл бұрын
My spider folder downloaded from flaticon doesn't hav the Files Idle, jump etc...what to do ?....
@MohdHamza
@MohdHamza 2 жыл бұрын
Hi Amey, Its the asset store where you will find these: assetstore.unity.com/packages/3d/characters/animals/insects/animated-spider-22986
@atulrankawat614
@atulrankawat614 Жыл бұрын
Great Video!!! Anyone knows how to get back the indicator after we're done with the changes with the object??
@nutvers1.0n
@nutvers1.0n 2 ай бұрын
Thanks
@balajinarayanan5544
@balajinarayanan5544 2 жыл бұрын
after adding the ARplacement script in controller ->the associated script cannot be loaded.please fix any compile errors and assign a valid script. this message is showing.
@thegodfather7419
@thegodfather7419 3 жыл бұрын
I don't know why its not working for me. After the start only one thing is visible and thats the black screen. Help If you can ''
@dylanr0662
@dylanr0662 3 жыл бұрын
It says object not set to an inferance for the camera in AR Placement script
@MohdHamza
@MohdHamza 3 жыл бұрын
Can you please recheck your AR Session Origin gameobject, has it got a camera in it. Can you also check the AR Placement script has no empty field left. Check the ARCamera has all scripts as in the video. Let me know how it goes.
@dylanr0662
@dylanr0662 3 жыл бұрын
@@MohdHamza Thanks for helping. I still get the error and the app doesn't show my phones camera
@MohdHamza
@MohdHamza 3 жыл бұрын
@@dylanr0662 Is there a way I can see your project?
@dylanr0662
@dylanr0662 3 жыл бұрын
@@MohdHamza you got discord I can message you pictures or videos
@MohdHamza
@MohdHamza 3 жыл бұрын
@@dylanr0662 ​ Sorry I haven't got discord servers set up yet. Looks like I will be needing one soon. In the meantime can you share your project using google drive on my email address in the about section of this channel?
@sen.chinese.tattoos
@sen.chinese.tattoos 2 жыл бұрын
I've watched a few of these tutorials now where it gets to the "Build and Run" step and then suddenly they're utilizing the file on their phone. Does anyone know of a tutorial that walks through the process of getting the file to the phone for utilization?
@hristiyanaleksandrov198
@hristiyanaleksandrov198 Жыл бұрын
Currently, I am wondering the same. Did you manage to find a answer?
@허준성-t2r
@허준성-t2r 3 жыл бұрын
Thank you for the tutorial, but I'm getting some error and warning. Error - Object reference not set to an instance of an object ARPlacement.UpdatePlacementPose() Warning - No active Unity.XR.ARSubsystems. Is there any method to solve this problem? Please help.
@MohdHamza
@MohdHamza 3 жыл бұрын
Please ensure you are using the same package versions as I have tested and mentioned in the description box. It also looks like the script has a method called at the wrong place. Check your script if it matches the one in the description. If any issues persist connect on the Discord server to share screenshots or media files.
@macrowaves624
@macrowaves624 3 жыл бұрын
@@MohdHamza I'm getting the same issue and I have all the right packages aND unity version. Whats you think the issue is?
@MohdHamza
@MohdHamza 3 жыл бұрын
@@macrowaves624 replied on discord!
@mugundhan0689
@mugundhan0689 2 жыл бұрын
@@MohdHamza I'am having the same error on play. How to solve?
@alexprinski4853
@alexprinski4853 2 жыл бұрын
I have the same problem
@pizramazrano723
@pizramazrano723 3 жыл бұрын
The app open but there is no spider and the target icon, so just whats on my camera. can u help me?
@MohdHamza
@MohdHamza 3 жыл бұрын
Sure, can you share project details or perhaps screenshots of your project on the discord server (link in description)
@rgbgaming11
@rgbgaming11 Жыл бұрын
Such an amazing work bro, I just need a little help with a problem,when I tried to build the project,I got an error of build.gradle and I dont Know what that means, can you help me out please
@DwipMakwana
@DwipMakwana 3 жыл бұрын
Everything seemed to work perfectly but only I can see the camera turned on but I cant see the placement marker, why so?
@MohdHamza
@MohdHamza 3 жыл бұрын
Can you share your project screenshots on discord (link in description), I think the placement indicator is not correctly created or the script injection didn't work.
@tathagatacreations9050
@tathagatacreations9050 3 жыл бұрын
hello sir, i am following u tutorial but i am getting error in the script like [08:15:38] Assets/ARPlacement.cs(5,34): error cs1002 ; expected so how to correct it sir plz help sir
@MohdHamza
@MohdHamza 3 жыл бұрын
It is very likely a semicolon or braces are missing somewhere. Try the script in the description box, hope that helps.
@AS-dn3wc
@AS-dn3wc 3 жыл бұрын
Hey thanks for the tutorial, I have followed all the step, mine is Unity 2021.2 version and accordingly I have installed all other supporting settings, but after built and run it's only showing Black screen, could you please help ???
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi Arzita, I think with your Unity version AR Packages version 4.0 and above are more compatible. Another thing you can possibly check is if you have got all the components correctly setup like the AR Raycast manager, select ARCore or ARKit (depending on platform) in Project Settings -> XR Plugins and other bits.
@AS-dn3wc
@AS-dn3wc 3 жыл бұрын
@@MohdHamza Thanks for your quick reply, Yes I have selected correct everything, followed every step of yours, still not happening..
@MohdHamza
@MohdHamza 3 жыл бұрын
@@AS-dn3wc Can you share screenshots on discord (link in description) of your project and player settings (especially the other settings) and XR plug-in management.
@SrilalithaRavuri
@SrilalithaRavuri 3 жыл бұрын
@@MohdHamza hi! I'm facing the exact same issue. Just a black screen on my phone
@MohdHamza
@MohdHamza 3 жыл бұрын
@@SrilalithaRavuri Hi, Many people have resolved them on my discord server, if you join that (link in description) you can read though the chats. There is no one way of resolving it. It can be due to multiple factors.
@yoho403
@yoho403 3 жыл бұрын
how do you get the animator tab? the only one i can find is the animation tab
@MohdHamza
@MohdHamza 3 жыл бұрын
On the top ribbon go to Windows -> Animation -> Animator. The animator window should show up.
@BahadrCAKARhosgeldin
@BahadrCAKARhosgeldin 2 жыл бұрын
The target is appear but, the spider doesn't appear after I clicked the target. Has anyone seen the same problem? Cheers,
@mishascookbook415
@mishascookbook415 3 жыл бұрын
Hey Mohd how can I contact you ?? I'm having a final year project
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, You can message me on discord (link in description)
@neerajverma9226
@neerajverma9226 Жыл бұрын
How to detect objects in AR and draw path in detected object
@UR.CristianoFans-q9y
@UR.CristianoFans-q9y 3 жыл бұрын
i have some issue regarding to camera if i am not place game object in front of camera then it will not visible in app also but when i place it and it seems in game view then its work correctly ..and in your case your game view is totally blank ..can you help me ?
@Praveenkumar-jb3wd
@Praveenkumar-jb3wd 2 жыл бұрын
HI Mohamed bro.I tried following the same versions of AR packages it showed some error, then I installed the latest verified version 4.1.7 and it worked. Now I followed the remaining steps after building the app shows black screen only( like the ar camere bsolid color Background) How to fix the issue. I deleted the main camera also
@rafael36326
@rafael36326 2 жыл бұрын
NullReferenceException: Object reference not set to an instance of an object ARPlacement.UpdatePlacementPose () (at Assets/Script/ARPlacement.cs:49) ARPlacement.Update () (at Assets/Script/ARPlacement.cs:30) NullReferenceException: Object reference not set to an instance of an object ARPlacement.UpdatePlacementPose () (at Assets/Script/ARPlacement.cs:49) ARPlacement.Update () (at Assets/Script/ARPlacement.cs:30) Error my screen is black!!
@alexprinski4853
@alexprinski4853 2 жыл бұрын
Really cool everything is progressing fine but when I start building it says "Manifest merger failed with multiple errors | Android Studio" Anyone know what the problem is?
@Medo1549
@Medo1549 3 жыл бұрын
Thanks for this video. it helped me a lot with a project. I have just a question, how to redo the process again( to place the object somewhere else while using the app without close it and start it again)
@MohdHamza
@MohdHamza 3 жыл бұрын
Great to hear that! In regards to your question first thing which comes to my mind is create a UI button which can do SceneManager.LoadScene(“Your scene”); This will reset the scene and work without closing and opening it again.
@Medo1549
@Medo1549 3 жыл бұрын
​@@MohdHamza Dear Sir, if you could help me alittle bit with the code with this button i would be appreciate. i should create a button and reload the scene like you said. so where should i write the code that relate to write my scene and connected to the button to reload it. THe code i have sofar is the same like you did in the video. it is for animating a robot exported from SW in AR. and everything working perfectly except this one. Thanks in advance
@MohdHamza
@MohdHamza 3 жыл бұрын
@@Medo1549 If you don't mind can you please post your issue with screenshots in the discord server (link in description). I can understand and reply better there. Thanks
@telesta
@telesta 3 жыл бұрын
Great Tutorials!! I cant load my model from the assets store. I dont know why that is the case.
@MohdHamza
@MohdHamza 3 жыл бұрын
Use the link in the description, sign in with your Unity credentials. In the editor in the package manager download first and then import. Should be straightforward.
@telesta
@telesta 3 жыл бұрын
@@MohdHamza it worked. Thanks for the reply.
@blabberbytes9967
@blabberbytes9967 3 жыл бұрын
How do you get the app on the phone? I'm trying to develop an ar experience for the public.
@MohdHamza
@MohdHamza 3 жыл бұрын
Ensure your device has developer mode switched on, then plug your phone into your machine running Unity and follow from @13:30 for Android. For iOS devices, you can refer to this video kzbin.info/www/bejne/iKvQc6Giobehnpo from 25:53. He presents very clearly how to build through Xcode.
@atanasvoynov
@atanasvoynov 3 жыл бұрын
I get errors on NullReferenceException: Object reference not set to an instance of an object ARPlacement.UpdatePlacementPose () (at Assets/Scripts/ARPlacement.cs:51) ARPlacement.Update () (at Assets/Scripts/ARPlacement.cs:31)
@MohdHamza
@MohdHamza 3 жыл бұрын
Can you share your project screenshots on discord channel.
@rajatgupta8339
@rajatgupta8339 3 жыл бұрын
@@MohdHamza I am also getting the same error. Could you please help me in that, if you understood the problem. Thanks in advance
@MohdHamza
@MohdHamza 3 жыл бұрын
@@rajatgupta8339 Hi Rajat, This error usually pops up when a certain gameobject is not found and the script is trying to access it. Can you share screenshots of your scene to better understand your issues. Sometimes its small things we miss out.
@ohhhinc7770
@ohhhinc7770 3 жыл бұрын
I think you have to add the component "ARRaycastManager" to your Controller gameObject to make this code work.
@MohdHamza
@MohdHamza 3 жыл бұрын
@@ohhhinc7770 Added on AR Session Origin Gameobject, check @4:47
@baopham96
@baopham96 3 жыл бұрын
Thank you! But does it run on ios browser like chrome or safari?
@MohdHamza
@MohdHamza 3 жыл бұрын
This tutorial is for iOS and Android devices. I think for browsers you might be looking into using WebGL build. AR in WebGL is something I have personally not done before.
@ahmadfarid8432
@ahmadfarid8432 3 жыл бұрын
I use ARcore but my phone camera not opening why?
@MohdHamza
@MohdHamza 3 жыл бұрын
There can be a lot of reasons for it. First check your phone is on Developer's mode. Then check all the package versions and unity versions are in line. Hope your device is compatible with ARCore. Let me know in more detail. Hope it works!
@telesta
@telesta 3 жыл бұрын
This is the error i am getting, "NullReferenceException: Object reference not set to an instance of an object ARPlacement.UpdatePlacementPose () (at Assets/script/ARPlacement.cs:51) ARPlacement.Update () (at Assets/script/ARPlacement.cs:31)" what could be the problem?
@MohdHamza
@MohdHamza 3 жыл бұрын
This looks like some field is left empty as the gameobject cannot be referenced. Try checking the gameobject on which AR placement script is sitting. Check if any field is left empty.
@aravindnitt3403
@aravindnitt3403 3 жыл бұрын
I am also getting the same error did you fix it?
@telesta
@telesta 3 жыл бұрын
@@aravindnitt3403 No. but the errors reduced when i made the 'AR Camera' the made main camera.
@telesta
@telesta 3 жыл бұрын
@@aravindnitt3403 apparently it worked for me even with the errors.
@aeropriest
@aeropriest 3 жыл бұрын
I found problem with camera, hits array and raycast - ended up declaring a public camera variable, assigned it from unity, created the hits array in start and updated the indicator position in update, see below code using System.Runtime.CompilerServices; using System.Linq.Expressions; using System.Diagnostics; using System.Runtime.InteropServices; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.ARFoundation; using UnityEngine.EventSystems; using UnityEngine.XR.ARSubsystems; public class PlaceOnPlane : MonoBehaviour { private ARRaycastManager raycastManager; List hits; public Camera m_MainCamera; public GameObject placementIndicator; // Start is called before the first frame update void Start() { raycastManager = GetComponent(); hits = new List(); } // Update is called once per frame void Update() { if( !m_MainCamera.enabled ){ UnityEngine.Debug.Log("Camera is not enabled, returning"); return; } var screenCenter = m_MainCamera.ViewportToScreenPoint(new Vector3(0.5f, 0.5f)); UnityEngine.Debug.Log("ViewportToScreenPoint converted"); if( !raycastManager.Raycast(screenCenter, hits) ){ UnityEngine.Debug.Log("Raycast manager failed"); } placementIndicator.SetActive(true); Pose pose = hits[0].pose; UnityEngine.Debug.Log("Set the marker position now"); placementIndicator.transform.SetPositionAndRotation(pose.position, pose.rotation); UnityEngine.Debug.Log("Marker position set"); } }
@sourabhsagare2630
@sourabhsagare2630 3 жыл бұрын
App installed but when app opens black screen is there only
@MohdHamza
@MohdHamza 3 жыл бұрын
Can you please check the the editor version, AR packages versions are in line?
@sourabhsagare2630
@sourabhsagare2630 3 жыл бұрын
@@MohdHamza Unity 2020.2.4F1 AR Foundation 4.0.12 ARCore 4.0.12 but these are the latest versions then why such problems occurs
@MohdHamza
@MohdHamza 3 жыл бұрын
So the version I have used which reliably works is mentioned in the description box of this video. The latest versions do not necessarily work, they should be taken as reference alone. Consider this bit as a combination lock, you need the right combination to make it work. I know its not ideal but unfortunately it is how it works.
@GeospatialTechnologies
@GeospatialTechnologies 3 жыл бұрын
Please, I am looking for a tutorial on how to play a video with audio using an image marker. In other words, user scans image marker with phone and a video with audio plays. I am finding plenty with vuforia but what about with AR Foundation? Thanks in advance!
@MohdHamza
@MohdHamza 3 жыл бұрын
Sure, will be making one soon.
@danjayson1
@danjayson1 3 жыл бұрын
Hi, The indicator takes a long time to appear on the ground or other flat surface, do you know what I might have done wrong?
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, If you are seeing the indicator then I believe you haven’t done anything wrong. The time taken for the indicator depends on your device ability to scan a plane surface while mapping it and also the texture of the surface you are scanning, so a coloured textured will be scanned quicker than a white one.
@geebee2928
@geebee2928 2 жыл бұрын
Hello, does AR Foundation and Lean Touch work if I deploy for WebGL?
@tashaabaskaran2951
@tashaabaskaran2951 2 жыл бұрын
hi! What if i want to spawn more than one object in the scene?
@MohdHamza
@MohdHamza 2 жыл бұрын
Hi, This might help: kzbin.info/www/bejne/ZoTYq6qAm9aaeLs
@tashaabaskaran2951
@tashaabaskaran2951 2 жыл бұрын
@@MohdHamza oh thank you!
@yapch1206
@yapch1206 3 жыл бұрын
Hello,I follow your steps and everything looks fine, but when I want to run it ,it show out that ''all compiler errors have to be fixed before you can enter play mode'' and it even can't build it.I've checked the scripts for multiple times but I still don't know where the problem is.
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, This clearly sounds like script error. I have attached a link to the script in the description box. Paste the script and then check. If the error persists share some screenshots of your problem on Discord(link in description)
@deelveshbunjun7674
@deelveshbunjun7674 3 жыл бұрын
@Mohd Hamza. Good tutorial. I wrote the code etc. But when i load app it the indicator doesn't move at all. Using 2020.3.17f. Any idea why?
@MohdHamza
@MohdHamza 3 жыл бұрын
Its the version issue. Try following this video kzbin.info/www/bejne/eoCVkIOGn9hknJY avoid the render pipeline bit, just use the script. Should work on 2020.3
@seanaugust6795
@seanaugust6795 3 жыл бұрын
Hi! When I started my app, the target logo is not showing. It was palced at 0,0,0, just like the ar camera
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, I hope that all the package versions and Unity versions are as per the video. If not, can you post log messages or screenshot on my Discord server (link in description).
@PushkarMokashi
@PushkarMokashi 3 жыл бұрын
Thank you for the tutorial, it's easy to follow. Just one error after building the app it says " The application requires the latest version of Google Play Services for AR". And after clicking on Continue it says the app is removed. Please help!
@MohdHamza
@MohdHamza 3 жыл бұрын
This sounds like your device is incompatible. Devices which are listed here are compatible : developers.google.com/ar/devices
@老子-l8r
@老子-l8r 3 жыл бұрын
I followed exactly what you did, but my android phone always shows a black screen?
@MohdHamza
@MohdHamza 3 жыл бұрын
Can you share more details about your project, Unity version, package versions used etc in the discord channel using screenshots? Will be easier to look into it.
@niharpatel332
@niharpatel332 2 жыл бұрын
It shows a "null reference exception: object reference not set to an instance of an object" error. What should I do ?
@Xx-nd1rs
@Xx-nd1rs 2 жыл бұрын
Did you know the solution?
@WingtoKwong
@WingtoKwong 3 жыл бұрын
I followed your script but it can't create a placementIndicator filed。。
@MohdHamza
@MohdHamza 3 жыл бұрын
Can you provide more details or perhaps send some screenshots of your project on discord channel (link in description)?
@WingtoKwong
@WingtoKwong 3 жыл бұрын
@@MohdHamza sorry, i done, I made mistake in script~
@elif-du2mf
@elif-du2mf Жыл бұрын
how do we make this work in unity 2021?
@PaoloBoffi
@PaoloBoffi 3 жыл бұрын
Hi, I'm still having a black screen problem, even if I tick the ARCore options under Project Settings -> XR Plug-in Management. Someone can help me please?
@MohdHamza
@MohdHamza 3 жыл бұрын
There can be multiple reasons to it. Could be versions, device or other settings. Can you share more details about your project. If you wish to share screenshots you are welcome to do so in my discord server (link in description)
@paulogarduque324
@paulogarduque324 3 жыл бұрын
sir need help! in my controller, Ar OBject to spawn and placement indicator did not appear, i can't place the placement indicator under the AR placement Script T_T
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi Paulo, Try using the AR Placement script in the description, if you face further problems and wish to share screenshots or files then you can use the discord server invite link in the description.
@tejaseknathpawar9113
@tejaseknathpawar9113 3 жыл бұрын
Hello.. This AR Placement Script is not working in my case. its showing its can not be loaded. have you changed or updated that script? Thanks.
@MohdHamza
@MohdHamza 3 жыл бұрын
The script has been the same. Can you show screenshots of your log or the error message in the discord server (link in description)
@mehulanshumali
@mehulanshumali 3 жыл бұрын
Dude, great content and great explanation. Just one modification require, by your script placement indicator doesn't appear after projecting the 3D model so if we change our camera angle we can't project any other model in any direction. So can you please modify you script . Thank you ❤️❤️
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi Mehul, I assume what you are trying is not to hide the placement indicator and spawn more objects when taped on the indicator. You could actually modify the code: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.ARFoundation; using UnityEngine.XR.ARSubsystems; public class ARPlacement : MonoBehaviour { public GameObject arObjectToSpawn; public GameObject placementIndicator; // private GameObject spawnedObject; private Pose PlacementPose; private ARRaycastManager aRRaycastManager; private bool placementPoseIsValid = false; void Start() { aRRaycastManager = FindObjectOfType(); } // need to update placement indicator, placement pose and spawn void Update() { if(placementPoseIsValid && Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) { ARPlaceObject(); } UpdatePlacementPose(); UpdatePlacementIndicator(); } void UpdatePlacementIndicator() { if(placementPoseIsValid) { placementIndicator.SetActive(true); placementIndicator.transform.SetPositionAndRotation(PlacementPose.position, PlacementPose.rotation); } else { placementIndicator.SetActive(false); } } void UpdatePlacementPose() { var screenCenter = Camera.current.ViewportToScreenPoint(new Vector3(0.5f, 0.5f)); var hits = new List(); aRRaycastManager.Raycast(screenCenter, hits, TrackableType.Planes); placementPoseIsValid = hits.Count > 0; if(placementPoseIsValid) { PlacementPose = hits[0].pose; } } void ARPlaceObject() { Instantiate(arObjectToSpawn, PlacementPose.position, PlacementPose.rotation); } } // I have used a notepad to edit the script. But hope this works.
@mehulanshumali
@mehulanshumali 3 жыл бұрын
​@@MohdHamza thank you so much, for this script, this helps me a lot in my AR project. One more thing is that by using this script we can generate multiple objects. Is it possible to spawn only one object? I mean that suppose first I spawn the object and after that, I have changed my camera angle and again I want to spawn the object then the previous one got destroyed and at a new place, it spawns again. So on a whole screen, only one object will be there not many. Thankyou again... :)
@Nicole-fg8nc
@Nicole-fg8nc Жыл бұрын
Hi, is this considered as AR Marker-less or Marker-Based AR project?
@MohdHamza
@MohdHamza Жыл бұрын
Hi, this is markerless, a marker based would be something like this kzbin.info/www/bejne/hajTg4Z8bL1sqas
@XX-lx3bk
@XX-lx3bk 3 жыл бұрын
Well done i have subbed you
@MohdHamza
@MohdHamza 3 жыл бұрын
Thanks 😊
@wowersdh1
@wowersdh1 3 жыл бұрын
I followed exact same and install to my phone, but doesn't work.. just black screen
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, There can be a number of reasons for this, can you share more details about the package versions, unity version, device details, and possibly a few screenshots on discord (link in description) of the console if you get errors.
@wowersdh1
@wowersdh1 3 жыл бұрын
@@MohdHamza unity version is 2020.3.7f1 and I think I solved black screen problem by checking ARcore in setting, but when starts it, camera view is gone and froze I might try again and if not working, I will share it through discord. Thanks for your reply!! :)
@jz9991z
@jz9991z 3 жыл бұрын
is there way to keep the scale above 1 for asset? Because navmesh does not work under scale of 1.
@MohdHamza
@MohdHamza 3 жыл бұрын
Sure, create an empty gameobject and make this asset a child of the empty. Then scale your empty gameobject as you desire and counter it by scaling the asset. Hope that works✌️
@jz9991z
@jz9991z 3 жыл бұрын
@@MohdHamza Hi, thank you for the reply. I made an empty object as parent and scaled it to 20, 20, 20 and made the child assets as 0.05, 0.05, 0.05. However, everything was too large in the build. Do I need to adjust the AR camera or something?
@MohdHamza
@MohdHamza 3 жыл бұрын
@@jz9991z scale of 20 does sound large. I believe you need to make the child objects scale to 0.005. Or make the parent scale as 2 and keep children at 0.05. I would advise not to touch the AR Camera in this case.
@jz9991z
@jz9991z 3 жыл бұрын
@@MohdHamza Cheers. Thanks for your help
@Blessindisguise
@Blessindisguise 3 жыл бұрын
I have issues getting it to work... (I see the app in my phone screen, and any objects I put in the scene but it don't use the phone's camera! It is just black if I add the sky box I see it on the phone... Two things I noticed: 1) I go to XR Plug-in management, and check ARCore, and try to run it it doesn't run.. I just hear the window 10 error chime. 2) I noticed when I choose "quad" the "X rotation" of "90" it shows in the scense upside down.. if I click -90 it looks fine! (The "directional light" is still above regardless). More info: I have Samsung Note 10+ Windows 10 pro laptop Connected via USB-C
@MohdHamza
@MohdHamza 3 жыл бұрын
This sounds like the AR Session is not running, can you share screenshots of your project and AR package versions you used in the discord channel?
@Blessindisguise
@Blessindisguise 3 жыл бұрын
@@MohdHamza oh okay I see yes I will do that later.
@Blessindisguise
@Blessindisguise 3 жыл бұрын
@@MohdHamza I just messaged you like 5 screenshots on Discord. Hopefully it helps!
@MohdHamza
@MohdHamza 3 жыл бұрын
@@Blessindisguise Replied.
@AbhimanyuVenu
@AbhimanyuVenu 8 ай бұрын
can u tell me the fix?@@MohdHamza
@Hemanutd14
@Hemanutd14 3 жыл бұрын
Hello, I built and run the app on Android but the screen is showing black and I can't see anything, can you tell me why this is happening. I took the code directly from description and deployed the app but it's still showing black, why is this?
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, can you share more details about the package versions, unity version, device details, and possibly a few screenshots on discord (link in description) of the console if you get errors.
@Hemanutd14
@Hemanutd14 3 жыл бұрын
@@MohdHamza sure, texted you on #general, would be great if you could check and help me out
@ainguyenvan3629
@ainguyenvan3629 3 жыл бұрын
i have a problem when i open app in my android device. "this application requires the latest version of ARCore", please help me. Thanks
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, Can you check if your device is listed here: developers.google.com/ar/devices If not then I'm afraid it won’t work. If your device is listed then please connect with me on my discord server(link in description).
@ainguyenvan3629
@ainguyenvan3629 3 жыл бұрын
@@MohdHamza ok thank you
@ukr-rus2496
@ukr-rus2496 3 жыл бұрын
Provide the script please
@MohdHamza
@MohdHamza 3 жыл бұрын
Thank you for the comment, please find the link in the description :}
@funcapfacts3050
@funcapfacts3050 3 жыл бұрын
I cant see the properties you have in the script
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, Try using the script docs.google.com/document/d/1z7xG20s7_jM7ftizfXexMd9b3ycYDfkBCPxUyRG3UNs/edit?usp=sharing . Should resolve your issue.
@isofisim2038
@isofisim2038 3 жыл бұрын
I see target true but spider not come when i tocuh to screen.
@MohdHamza
@MohdHamza 3 жыл бұрын
Have you checked the fields are not empty in the inspector where you placed the AR placement script?
@MrDestinyproduction
@MrDestinyproduction 3 жыл бұрын
Hi Does this tutorial work with Unity 2019.4.17? just to save myself from being frustrated LOL
@MohdHamza
@MohdHamza 3 жыл бұрын
It works in 2019.2 and 2020.1, I have not tested others so honestly can't confirm.
@MrDestinyproduction
@MrDestinyproduction 3 жыл бұрын
@@MohdHamza Thank you so much. I guess I have to install that version. Also do you know how to use Vuforia?
@MohdHamza
@MohdHamza 3 жыл бұрын
@@MrDestinyproduction Yes I have used Vuforia in the past, however I'm more into ARFoundation as of late.
@MrDestinyproduction
@MrDestinyproduction 3 жыл бұрын
@@MohdHamza oh ok cos I’m having trouble putting my Vuforia application into my iPhone.
@MohdHamza
@MohdHamza 3 жыл бұрын
@@MrDestinyproduction Oh, honestly can't really help with Vuforia. Just did a quick search and found this kzbin.info/www/bejne/nXrWq2SqdrKKjNU Its for android and the language is different but may get what you want as his app was working.
@normalkullanm9364
@normalkullanm9364 3 жыл бұрын
Can I embed Unity AR Foundation (ARCore) scenes in native Android app(Android Studio) ?
@MohdHamza
@MohdHamza 3 жыл бұрын
Never tried that honestly mate. I have tried building AR apps using Swift and xcode for iOS devices which didn't require Unity or AR Foundation. There should be something similar for Android studio.
@rithik4293
@rithik4293 3 жыл бұрын
It doesn;t work :( the target stays at one location and the spider never spawns. Any idea why?
@MohdHamza
@MohdHamza 3 жыл бұрын
This could be because of a few reasons. Check that your placement indicator gameobject has a quad as a child. Additionally it should be inserted in ARplacement script. Hope that works.
@rithik4293
@rithik4293 3 жыл бұрын
Yes I checked all of them multiple times, it doesn't work :( I have a quad and I have placed the placement indicator as one of the game objects for the script
@rithik4293
@rithik4293 3 жыл бұрын
Actually i figured it out, it was a very dumb error. I forgot to import the raycast and planemanager scripts
@MohdHamza
@MohdHamza 3 жыл бұрын
@@rithik4293 Oh great, glad it worked!
@firdiansyahramadhan7541
@firdiansyahramadhan7541 3 жыл бұрын
hey, use github instead of docs
@MohdHamza
@MohdHamza 3 жыл бұрын
Yeah, should have done from the beginning. Will create a repository soon!
@manujoseph2545
@manujoseph2545 3 жыл бұрын
Provide script so that we can copy-paste ;)
@MohdHamza
@MohdHamza 3 жыл бұрын
Thank you for the comment, I have added the link in the description!
@muntahajameel3845
@muntahajameel3845 3 жыл бұрын
how can we add more than one 3d objects???
@MohdHamza
@MohdHamza 3 жыл бұрын
Try this kzbin.info/www/bejne/ZoTYq6qAm9aaeLs
@ratford2
@ratford2 2 жыл бұрын
The information in it was great but a little bit of editing of this video could have gone a long way to making it a batter video.
@SatyamSingh-vd1xk
@SatyamSingh-vd1xk 3 жыл бұрын
Can you please upload the app too if possible... please 🙏🏼❤️
@SatyamSingh-vd1xk
@SatyamSingh-vd1xk 3 жыл бұрын
Mine is not working...a lot of error in mine
@MohdHamza
@MohdHamza 3 жыл бұрын
@@SatyamSingh-vd1xk Hi Satyam, I'll try creating a Github repository later. In the meantime can you list what errors are you getting?
@sollekram
@sollekram 2 жыл бұрын
Great guide, but you should have started, WARNING: WHOEVER HAVE ARACHNOPHOBIA DO NOT PROCEED.
@MohdHamza
@MohdHamza 2 жыл бұрын
😂
@lookpla132
@lookpla132 3 жыл бұрын
phone screen was black.
@MohdHamza
@MohdHamza 3 жыл бұрын
Hi, there can be multiple reasons for this. Can you please explain a little more, perhaps showing your console if you got errors. Further you can post screenshots on Discord(link in description) to illustrate the issue.
@dhairyapandya5550
@dhairyapandya5550 Жыл бұрын
Can you please help me I have raised a issue in discord server ...
@MohdHamza
@MohdHamza Жыл бұрын
Replied
@hamiduzi7599
@hamiduzi7599 Жыл бұрын
ARCORE sucks... VUFORIA has way less issues than this XR thing
@UnofficialEngineering
@UnofficialEngineering Жыл бұрын
Dude I tried it like yesterday and Vuforia said nah:/
@ericccowan
@ericccowan 3 жыл бұрын
How do you move the app to the phone?
@MohdHamza
@MohdHamza 3 жыл бұрын
So as shown in this case, if you’re using Android plug your phone into your computer, follow from @13:25. Make sure your mobile device has developer mode activated. The app should build up on your phone. Hope it works👍
@kayajones9215
@kayajones9215 3 жыл бұрын
@@MohdHamza Can you give a tutorial on how to build it through xcode
@MohdHamza
@MohdHamza 3 жыл бұрын
@@kayajones9215 : I can't create a tutorial at the moment however you can refer to this video kzbin.info/www/bejne/iKvQc6Giobehnpo from 25:53. He presents very clearly how to build through Xcode.
@ardatekinalp6663
@ardatekinalp6663 3 жыл бұрын
It did not work
@MohdHamza
@MohdHamza 3 жыл бұрын
Please could you explain the issue?
@ardatekinalp6663
@ardatekinalp6663 3 жыл бұрын
@@MohdHamza I deleted the project. The error was with the script file that you wrote and the phone screen was simply black.
@_shikharshukla_YT
@_shikharshukla_YT 3 жыл бұрын
Great Content ..Horrible Presentation...why do you have to speed up so much...makes it so difficult to track what happened..
@MohdHamza
@MohdHamza 3 жыл бұрын
Thank you for the feedback! I thought posting an hour long video wouldn’t be helpful when more things can be covered in approx 15min. Hey, you can slow it down if required. Will keep your feedback in mind.
@_shikharshukla_YT
@_shikharshukla_YT 3 жыл бұрын
@@MohdHamza I did follow the video that way...but at many points actions were like what the hell happened...and I had put another 10 mins to find solution and debug...I am hopeful you'll understand the difference between this and a professional course video...Still a good video..AllTheBestBro...Grow 1000x
@MohdHamza
@MohdHamza 3 жыл бұрын
@@_shikharshukla_YT Thanks, noted!
Augmented Reality (AR) tutorial for beginners using Unity 2022
32:11
Playful Technology
Рет қаралды 301 М.
Worst flight ever
00:55
Adam W
Рет қаралды 33 МЛН
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 5 МЛН
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 106 МЛН
Get Started with AR in Unity in 6 minutes!
6:59
Novaborn
Рет қаралды 132 М.
I tried coding my own graphics engine
4:23
Garbaj
Рет қаралды 204 М.
Unity Augmented Reality Tutorial Lesson 01 - AR Simulation
15:57
lightsandclockwork
Рет қаралды 24 М.
Make an Augmented Reality game in Unity!
16:26
Tudor Barbulescu
Рет қаралды 18 М.
Making an atomic trampoline
58:01
NileRed
Рет қаралды 8 МЛН
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 5 МЛН