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 ✌️
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.
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!
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 :)
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.
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.
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 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?
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!
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✌️
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??
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.
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.
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 ?
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.
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 ???
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 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 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.
Hi! I'm wondering if you have a video that covers background segmentation. I'm trying to create an AR experience where the target image "burns up", revealing more of the image's background behind it. Is this possible using camera texture/segmentation?
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
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.
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?
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
Hi Anang, I have discussed scaling and rotating using sliders in this video: ruclips.net/video/43XRkmAmscM/видео.html Scaling by touch is discussed here: ruclips.net/video/ISBIu6Jzfk8/видео.html I haven’t built drag functions yet but will do so in the future.
Its the version issue. Try following this video ruclips.net/video/DO2_PPjs1f4/видео.html avoid the render pipeline bit, just use the script. Should work on 2020.3
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?
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.
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 ruclips.net/video/RzmBnllRnh8/видео.html from 25:53. He presents very clearly how to build through Xcode.
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)
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.
@@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
@@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
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.
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).
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✌️
@@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?
@@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.
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
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.
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
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?
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.
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"); } }
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.
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)
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)
@@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.
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 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?
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!
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?
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)
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.
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!
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!
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).
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?
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.
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.
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.
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!!
@@MrDestinyproduction Oh, honestly can't really help with Vuforia. Just did a quick search and found this ruclips.net/video/gIsz1tAMWVs/видео.html Its for android and the language is different but may get what you want as his app was working.
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.
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 ❤️❤️
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.
@@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... :)
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.
@@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!! :)
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
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.
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
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 : I can't create a tutorial at the moment however you can refer to this video ruclips.net/video/RzmBnllRnh8/видео.html from 25:53. He presents very clearly how to build through Xcode.
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.
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.
@@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
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
✌️
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
@@gabrielboiciuc2517 Is your phone supported and in developer mode?
@@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
@@drummsnikk5073 Hi, its a google pixel 2. Have you got a supported device ?
@@MohdHamza Read the ARCore list few minutes ago.. seems I don't have a supported device... i'm desperate ahah
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.
i get this everytime - Manifest merger failed with multiple errors, see logs
how to solve?
Thank you @Timha you saved my time
OMG.IT'S WORKING :))
Very helpful comment, this fixed my problem instantly!
Hello. I try to make this app and i have some problems. Can you help me?
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!
Glad you liked it😊
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 :)
Glad it helped!
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.
Thanks you!!
Thank you so much :)
Sadly unity told that the camera variable is not assigned
@@solomon6957 is there any solution to that??
Thank you brother. U literally just helped me to gain a perfect score in my Multimedia subject
Don't forget to select ARCore or ARKit (depending on platform) in Project Settings -> XR Plugins
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.
@@Blessindisguise sometimes the blackscreen is because you forgot to delete the main camera! i make tutorials too, come visit!
my friend you sounded more confident than most of my college teachers !!! 😭😂
Great tutorial! You have been super clear, thank you.
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?
This module shall work on ARCore and ARKit supported devices. Don’t think it will work elsewhere.
@@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?
I am creating AR and AR Portal for Unity. I liked your first video and subscribed. Keep up the good work.
Thank you very much! All the best with your project 👍🏻
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!
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✌️
My spider folder downloaded from flaticon doesn't hav the Files Idle, jump etc...what to do ?....
Hi Amey,
Its the asset store where you will find these: assetstore.unity.com/packages/3d/characters/animals/insects/animated-spider-22986
This is awesome. Straight to the point
Did you add the component "ARRaycastManager" to your arController? Otherwise this will not work. No?
NICE BROTHER HELPED ME ALOT
Hi ..I follow all your guidelines. run it on Redmi note 7 pro device but it seems blank.
Thanks for the video, awesome stuff!! Keep it up
Great tut bro!!! Thanks loads!!
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??
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.
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.
@@MohdHamza I'm getting the same issue and I have all the right packages aND unity version. Whats you think the issue is?
@@macrowaves624 replied on discord!
@@MohdHamza I'am having the same error on play. How to solve?
I have the same problem
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 ?
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.
Thanks Man ! Really helpful series !
Thanks for the appreciation!
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 ???
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.
@@MohdHamza Thanks for your quick reply, Yes I have selected correct everything, followed every step of yours, still not happening..
@@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.
@@MohdHamza hi! I'm facing the exact same issue. Just a black screen on my phone
@@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.
The app open but there is no spider and the target icon, so just whats on my camera. can u help me?
Sure, can you share project details or perhaps screenshots of your project on the discord server (link in description)
Hi! I'm wondering if you have a video that covers background segmentation. I'm trying to create an AR experience where the target image "burns up", revealing more of the image's background behind it. Is this possible using camera texture/segmentation?
how do you get the animator tab? the only one i can find is the animation tab
On the top ribbon go to Windows -> Animation -> Animator. The animator window should show up.
thank you for this great and useful tutorial.
i made a couple of changes to be able to spawn multiple spiders and changed the camera from current to main too
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 ''
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
It is very likely a semicolon or braces are missing somewhere. Try the script in the description box, hope that helps.
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?
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.
Hello, does AR Foundation and Lean Touch work if I deploy for WebGL?
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?
Currently, I am wondering the same. Did you manage to find a answer?
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
Good job buddy......excellent video..can you please help me that..how can i drag rotate or scale that 3d object ..
Hi Anang,
I have discussed scaling and rotating using sliders in this video: ruclips.net/video/43XRkmAmscM/видео.html
Scaling by touch is discussed here: ruclips.net/video/ISBIu6Jzfk8/видео.html
I haven’t built drag functions yet but will do so in the future.
Thank you ...but how to rotate and drag with finger touch on screen only
Great Video!!!
Anyone knows how to get back the indicator after we're done with the changes with the object??
@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?
Its the version issue. Try following this video
ruclips.net/video/DO2_PPjs1f4/видео.html avoid the render pipeline bit, just use the script. Should work on 2020.3
Thanks for upload this video :)
Thanks for your appreciation!
Hey Mohd how can I contact you ??
I'm having a final year project
Hi,
You can message me on discord (link in description)
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?
well done mate
Thank you :)
Thank you! But does it run on ios browser like chrome or safari?
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.
How do you get the app on the phone? I'm trying to develop an ar experience for the public.
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 ruclips.net/video/RzmBnllRnh8/видео.html from 25:53. He presents very clearly how to build through Xcode.
Great content 👍🏻
Thanks 😊
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)
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.
@@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
@@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
Thanx, I am a beginner and I can follow you;-)
Everything seemed to work perfectly but only I can see the camera turned on but I cant see the placement marker, why so?
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.
Hi! When I started my app, the target logo is not showing. It was palced at 0,0,0, just like the ar camera
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).
is there way to keep the scale above 1 for asset? Because navmesh does not work under scale of 1.
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✌️
@@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?
@@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.
@@MohdHamza Cheers. Thanks for your help
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
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.
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
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?
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.
I am also getting the same error did you fix it?
@@aravindnitt3403 No. but the errors reduced when i made the 'AR Camera' the made main camera.
@@aravindnitt3403 apparently it worked for me even with the errors.
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");
}
}
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.
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)
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)
Can you share your project screenshots on discord channel.
@@MohdHamza I am also getting the same error. Could you please help me in that, if you understood the problem. Thanks in advance
@@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.
I think you have to add the component "ARRaycastManager" to your Controller gameObject to make this code work.
@@ohhhinc7770 Added on AR Session Origin Gameobject, check @4:47
Thank you so much, sir.. it is a big help for me as a beginner! it worked! kudos! God Bless! :D
Hi Paulo, Great to hear that. Best of luck ahead!!
@@MohdHamza hello sir, can i ask if you have other projects that can I learn from?
@@paulogarduque324 At the moment you can follow the playlist. I haven’t uploaded any other projects on public platforms yet.
@@MohdHamza thank you so much sir :D
It shows a "null reference exception: object reference not set to an instance of an object" error. What should I do ?
Did you know the solution?
It says object not set to an inferance for the camera in AR Placement script
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.
@@MohdHamza Thanks for helping. I still get the error and the app doesn't show my phones camera
@@dylanr0662 Is there a way I can see your project?
@@MohdHamza you got discord I can message you pictures or videos
@@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?
Tanks man!!!!
How to detect objects in AR and draw path in detected object
hi! What if i want to spawn more than one object in the scene?
Hi,
This might help: ruclips.net/video/0SuzwJfqgBY/видео.html
@@MohdHamza oh thank you!
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!
This sounds like your device is incompatible. Devices which are listed here are compatible : developers.google.com/ar/devices
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?
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)
Great Tutorials!! I cant load my model from the assets store. I dont know why that is the case.
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.
@@MohdHamza it worked. Thanks for the reply.
Awesome!!
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!
Sure, will be making one soon.
I use ARcore but my phone camera not opening why?
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!
i have a problem when i open app in my android device. "this application requires the latest version of ARCore", please help me. Thanks
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).
@@MohdHamza ok thank you
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?
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.
@@MohdHamza sure, texted you on #general, would be great if you could check and help me out
Hi, is this considered as AR Marker-less or Marker-Based AR project?
Hi, this is markerless, a marker based would be something like this ruclips.net/video/OwpRSF7X9sI/видео.html
how do we make this work in unity 2021?
The target is appear but, the spider doesn't appear after I clicked the target. Has anyone seen the same problem? Cheers,
Can I embed Unity AR Foundation (ARCore) scenes in native Android app(Android Studio) ?
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.
Thanks
App installed but when app opens black screen is there only
Can you please check the the editor version, AR packages versions are in line?
@@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
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.
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!!
I followed your script but it can't create a placementIndicator filed。。
Can you provide more details or perhaps send some screenshots of your project on discord channel (link in description)?
@@MohdHamza sorry, i done, I made mistake in script~
Hi Does this tutorial work with Unity 2019.4.17? just to save myself from being frustrated LOL
It works in 2019.2 and 2020.1, I have not tested others so honestly can't confirm.
@@MohdHamza Thank you so much. I guess I have to install that version. Also do you know how to use Vuforia?
@@MrDestinyproduction Yes I have used Vuforia in the past, however I'm more into ARFoundation as of late.
@@MohdHamza oh ok cos I’m having trouble putting my Vuforia application into my iPhone.
@@MrDestinyproduction Oh, honestly can't really help with Vuforia. Just did a quick search and found this ruclips.net/video/gIsz1tAMWVs/видео.html
Its for android and the language is different but may get what you want as his app was working.
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.
The script has been the same. Can you show screenshots of your log or the error message in the discord server (link in description)
I followed exactly what you did, but my android phone always shows a black screen?
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.
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 ❤️❤️
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.
@@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... :)
I cant see the properties you have in the script
Hi,
Try using the script docs.google.com/document/d/1z7xG20s7_jM7ftizfXexMd9b3ycYDfkBCPxUyRG3UNs/edit?usp=sharing . Should resolve your issue.
I followed exact same and install to my phone, but doesn't work.. just black screen
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.
@@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!! :)
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.
I see target true but spider not come when i tocuh to screen.
Have you checked the fields are not empty in the inspector where you placed the AR placement script?
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
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?
@@MohdHamza oh okay I see yes I will do that later.
@@MohdHamza I just messaged you like 5 screenshots on Discord. Hopefully it helps!
@@Blessindisguise Replied.
can u tell me the fix?@@MohdHamza
how can we add more than one 3d objects???
Try this ruclips.net/video/0SuzwJfqgBY/видео.html
Well done i have subbed you
Thanks 😊
Great guide, but you should have started, WARNING: WHOEVER HAVE ARACHNOPHOBIA DO NOT PROCEED.
😂
Provide the script please
Thank you for the comment, please find the link in the description :}
It doesn;t work :( the target stays at one location and the spider never spawns. Any idea why?
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.
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
Actually i figured it out, it was a very dumb error. I forgot to import the raycast and planemanager scripts
@@rithik4293 Oh great, glad it worked!
Provide script so that we can copy-paste ;)
Thank you for the comment, I have added the link in the description!
Can you please upload the app too if possible... please 🙏🏼❤️
Mine is not working...a lot of error in mine
@@SatyamSingh-vd1xk Hi Satyam, I'll try creating a Github repository later. In the meantime can you list what errors are you getting?
How do you move the app to the phone?
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👍
@@MohdHamza Can you give a tutorial on how to build it through xcode
@@kayajones9215 : I can't create a tutorial at the moment however you can refer to this video ruclips.net/video/RzmBnllRnh8/видео.html from 25:53. He presents very clearly how to build through Xcode.
hey, use github instead of docs
Yeah, should have done from the beginning. Will create a repository soon!
phone screen was black.
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.
Can you please help me I have raised a issue in discord server ...
Replied
ARCORE sucks... VUFORIA has way less issues than this XR thing
Dude I tried it like yesterday and Vuforia said nah:/
It did not work
Please could you explain the issue?
@@MohdHamza I deleted the project. The error was with the script file that you wrote and the phone screen was simply black.
Great Content ..Horrible Presentation...why do you have to speed up so much...makes it so difficult to track what happened..
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.
@@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
@@_shikharshukla_YT Thanks, noted!