I've uploaded the project shown in this video to Github. The video description is updated with that link, but here it is for convenience: github.com/TheUnityWorkbench/tuw-arfoundation-demo
Thanks for sharing the project files, Kris! This was really helpful. I managed to create my Android and iOS packages following you steps. iOS version worked perfectly as you instructed. But Android version is not working. When I launch the application on my Pixel 2, it doesn't show the placement indicator and because of that plane model is no getting added. One thing I noticed which publishing android version, I get Android SDK is outdated message (SDK build tool version 28.0.1 < 28.0.3). Did I miss any step?
That's awesome mate. Tell me something. Is it possible to export the tracked data in some way? For instance, can a point cloud or a mesh be created using the tracked data so that it may be exported as an OBJ or FBX? Thanks.
Really great tutorial. Professional quality and very easy to follow, job well done sir, congratulations. Only one addendum, they changed something in ARFoundation with the Raycast. Here are some steps to follow. 1.- Add the script to the "AR Session Origin" GameObject. All the steps that follow are in the same script you are working in during this tutorial. 2.- Add to the top: using UnityEngine.XR.ARSubsystems; 3.- Create a variable: private ARRaycastManager aRRaycastManager; 4.- In the Start Method add: aRRaycastManager = FindObjectOfType(); 5.- Instead of arOrigin use aRRaycastManager Should look like this: aRRaycastManager.Raycast(screenCenter, hits, TrackableType.Planes); That should cover it.
For everyone having problems on android with the placement indicator not showing i got it working! This is what i did: 1. To your AR Session Origin gameobject add the component "ARPlaneManager". (You do not need to provide a plane prefab unless you want to visualize the detected planes) 2. In the Tracked Pose Driver component of you AR Camera change the Update Type to "Update" (The marker will still show if you omit this step but it will be super jittery) 3. Enjoy a smooth marker! :D
Very interesting tutorial and your way of explaining is really really good ! Not too fast, not too slow, pointing out interesting details, calm voice, just perfect ! Please, continue ! :)
This is the best execution of any Unity tutorial I’ve ever seen. The pacing is perfect and you ex-pained all of the concepts and needed details to both follow along and carry the knowledge forward for our own use. I’m hopeful you’ll create more in the future. Unity should pick you up to do their official tutorials. Would love to see one on using the various AR remote capabilities (ARKit remote, ARFoundation remote). It seems there is extremely sparse information on these and no reliable documentation on actually getting them working.
Great introduction to AR Foundation. Thanks! One word of caution to those following along, versions matter. I have found that the following component versions work to recreate this app. AR Foundation [1.0.0-preview.22] - 2018-12-13 ARCore XR Plugin [1.0.0-preview.24] - 2018-12-13 ARKit XR Plugin [1.0.0-preview.20] - 2018-12-13 Unity 2018.3.14f1 Xcode 10.2.1 (10E1001) macOS 10.14.6 (18G29g) There are more recent versions of these components but this configuration seems to work best
Ethan thank you for the comment, I was beginning to think this comment section was retired. I’ve followed this tutorial multiple times, and have tried all the fixes mentioned in the comments. I keep getting an app that loads the unity logo then becomes a black screen and never does anything beyond that. I will now follow your advice and I’ll get each exact component you mentioned. Thank you again.
@@siddharthasapkota2219 Hi,I am a bit late but if you are still following the tutorial, which I think you won't, follow the steps to avoid a black screen: build settings -->Player settings ->XR plugin Management-> tick the AR core checkbox hope this will resolve your issue
Seriously thought this was from an official unity channel. Exceptionally well made tutorial! Please consider doing more videos Sir! I'm confident that view count will reach ~500k each. Could earn you a living very soon! Definitely subbed and liked! Looking forward to more!
Solution for the problem of black background and no permission asks: Go to the player settings -> XR Plugin -> XR Plugin Management and then in iOS enable the ARKit box and the ARCore box in the Android part
First of all, thanks for this great tutorial, it's really well explained. Secondly, I want to say that I had some problems with detecting the plain on my Android device, especially when switching from the floor to the table and I observed that my camera was not in focus. If someone has the same problem here is the solution I found: Add the "AR Camera Options" component to your "Placement Indicator" and make sure the Focus Mode is Auto. The camera will always try to find a focus point and the image doesn't look blurry anymore. Hope this helps.
Being a novice in C+ scripting what would the code look like? I was able to add the component to the AR Origin GameObject, but was unable to adjust the script accordingly. Could you make the correct code accessible in some way?
@@erik_natzke Hi Erik, thanks for the quick repsonse! That worked like a charm. Could you tell me why I am now not able to add the Toy plane prefab? It gives me the following when I try to add it to the scene: Unable to instantiate prefab. Prefab may be broken. UnityEditorInternal.InternalEditorUtility:HierarchyWindowDrag(HierarchyProperty, Boolean, HierarchyDropMode) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
I watched a couple of Unity & ARkit tutorials. This is one of the best! Very clear and most up-to-date with the tools. I just subscribed to your channel.
Holy cow... I don't have a mac or an android device so I need to wait until I have access to either of those to build to a device, but this is a fantastic tutorial. I'm already proficient in unity, but I didn't feel like you were wasting any time at all. You were really easy to follow and explained everything perfectly. Thanks!
Thank you so much! What a great tutorial! You should put a complete course together. I would be the one to buy it. I have not seen anyone explain the coding so well. Usually they just go through it and just tell you what to write without any explanation or logic.
So glad you found it helpful and like the style, Ebrahim. I promise to make more, it's just a matter of caving out the time. Please post suggestions on any specific general or AR-specific Unity topic you're interested in seeing me cover.
@@TheUnityWorkbench Thanks! One thing that I think would be really interesting to see is how to create indoor maps also showing you on the map. Please see link for sample video: th-cam.com/video/kGkT3YKOGXU/w-d-xo.html I'm trying to figure out how the corner map is done. I haven't been able to find any tutorials.
First of all thanks for the amazing tutorial, was really helpful. For those who were unable to see the placement indicator: 1. Device should support arcore( i have rooted redmi note 7 device which officially does not support ARcore after root everything should work fine). 2. Depending on your camera quality and lighting conditions it may take some time for indicator to appear 3. If scene is not working uncheck x86 under target architectures in player settings 4. In the new versions of AR foundation you don't need to check AR core support under XR settings Thanks again. I am planning to create AR application using Chrome browser, hopefully you can give me some tips
Amazingly clear and well presented material. You have an amazing talent at teaching this material and presenting it in a clear and concise manner. Hope to see more!
I followed til 09:14 and I am using android device. The app opens but It never shows the cube. It asked for camera permission too, i gave it but I can't see the cube
For many of you with problems, ARFoundation have evolved a lot since this video (it is in preview after all). To be able to follow this, look at 4:17 at the versions of each Package. Try to get those specific versions of the packages in the Package Manager, by clicking the arrow beside the package name and then "See all versions". Having said that, for some reason, it only worked here with AR Foundation "preview.6 - 1.1.0", which is one version above what is shown in the video. Also, if you are using Android, there is a comment by Conviley which fixes the Indicator not showing.
Sorry for the lack of respect from me. I did the tutorial and I did not use the like button to help more people to reach this good video. Thanks for sharing your knowledge
Thank you so much for this tutorial. The voicing was professional and clear, which made it easy to follow. I would love to see a version of this, or a video addendum, that addresses using tracking images.
Thanks for the tutorial! I'm following without any errors up until 09:00. After that it stops - I can't launch the first iOS build on my iPhone 7. When I try to run the iOS build from Xcode, I'm getting 76 error messages about "undefined symbols". Any ideas on what might be causing these issues?
I had the same problem and found a fix for me, it was because at the package manager in min 4:11 I installed the updated ARFoundation-Arkit-ARcore 2.0 versions, the correct versions are the 1.0 versions, if you see closely the moment he installs in the video and pause youll see the correct versions.. same answer here => forum.unity.com/threads/error-when-building-samplescene-from-arfoundation-to-iphone-6s.545338/#post-4629886
Have a problem getting the Raycasting. The compiling does not occur and throws up this error. Any help is appreciated :) .Error CS1061: 'ARSessionOrigin' does not contain a definition for 'Raycast' and no accessible extension method 'Raycast' accepting a first argument of type 'ARSessionOrigin' could be found (are you missing a using directive or an assembly reference?) (CS1061) (Assembly-CSharp)
Wulum, I’m very anxious to do more but I’m in the midst of a big move and job change, so my free time is scarce at the moment. I hope to be getting back into video making in the next month or two.
@@TheUnityWorkbench Thanks for your honest response. Right now we're preparing a Demo of our next game using what we learned on this tutorial. We hope that soon you'll be able to create another where we can scale, rotate a scene, and Raycast Game Objects.
Thanks! what a great tutorial! perfect! I really liked the way you walk us through the code with the level of details you choose to talk about... and it also very clear that the force is strong with you!... please do more!, especially for ARFoundation... this thing is creasy new and should have much more information about it.
Thanks for the positive feedback, Ariel! I've already got the next ARFoundation video planned and started. If you have specific questions, techniques, or challenges you'd like to see covered LMK.
For people having problem with the placement indicator being stuck, not moving, or rotating. What you need to do is add the following components to your AR Session Origin: -AR Raycast Manager (Sript) -AR Plane Manager (Script) Hope this helps
The quality of this video and your explanation are really top level, if you have an online course or any pay material, please let me know because you have buyer on me!
Hi, I did all the steps of the tutorial. When I run the app on the android mobile to show the cube this works fine, but when I continue with the tutorial making the changes to show the Placement Indicator, when running the app the Placement Indicator is not visible on any surface. I am using Windows 10, Unity 2018.1.7 and ARCore.
Luis, I'll look into this when I can find some time. It might be a couple weeks, though (sorry!). Can you try this with 2018.3 and see if you get different results? (That's the version I used for the tutorial.)
appear same problem too.... so i try to solve this problem to revise 'TrackableType.plane -> TrackableType.FeaturePoint'. this solution is a temporary measure. this link show how to operate th-cam.com/video/cuWEoh7PFTQ/w-d-xo.html i am using widows10, unity 2018.3 and ARcore
If you add the ARPlaneManager component to the AR Session Origin gameobject the marker will appear. However, it does not perform as smooth as in the video and i'm not sure why. According to the scripting API: "When [ARPlaneManager component is] enabled, this component subscribes to planeAdded, planeUpdated, and planeRemoved. If this component is disabled, and there are no other subscribers to those events, plane detection will be disabled on the device." So it seems like you have to have the ARPlaneManager or at least something else subscribing to those events to get plane detection to enable. using Unity 2018.3.3f1
I got it working! This is what i did: 1. To your AR Session Origin gameobject add the component "ARPlaneManager". (You do not need to provide a plane prefab unless you want to visualize the detected planes) 2. In the Tracked Pose Driver component of you AR Camera change the Update Type to "Update" (The marker will still show if you omit this step but it will be super jittrey) 3. Enjoy a smooth marker! :D
In android,the placement indicator is being shown at the start,but it just stays there and does not move along with the camera. any idea why ? And also the cube is not being placed on the click.
Does it count if I keep pressing the like button over and over again??? Great tutorial, this single tutorial answered all my questions I had. I was ready to search for multiple videos to get all my answers, but this first video answered all of them!!
Successfully installed on IOS 12.3.1 iphone 8, using mac pro 2013, mojave, unity 2018.4.3f1, xcode 10.2.1, ARfoundation 1.0.0-preview.22, ARCore XR plugin 1.0.0-preview.24, ARKit 1.0.0-preview.20, (I bought the apple developer program, dont know if it was necesary).. successfully installed on android 8.0, Samsung S7 edge.. failed to install on huawei 30prolite cause it doesnt support ARCore, maybe with vuforia, I suppose. Is important to say that in the minute 14:36 when he choose "auto generate the method", a new "using system" library is created at the top of the script, and he didnt mention it, in orden to achieve the touch input is necesary to insert that library.
Thanks for the tutorial. Interesting way to use scene's scale to shrink the object, instead of making objects smaller.. I will retype the code, when I will have a time :)
I'm just starting off with AR I'd appreciate any help i can get. I deployed the app to my iPhone from Xcode but all i get is a black screen. How can i fix that?
If you're wondering how to test and debug AR features in Unity Editor, here is a plugin I wrote for this purpose. I hope it will save someone hours of compilation time after every minor change. AR Foundation Editor Remote: forum.unity.com/threads/ar-foundation-editor-remote-test-and-debug-your-ar-project-in-the-editor.898433/
For everyone having issues with Unity 2019.2.0f1 and ARCore - ARFoundation 2.2.0 on Android here is a working code you will also need to add an AR Raycast Manager, an AR Plane manager with empty prefab and an AR Point Cloud manager with an empty prefab too like Conviley said in your AR Session Origin object using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.XR.ARFoundation; using UnityEngine.XR.ARSubsystems; public class ARTapToPlaceObject : MonoBehaviour { public GameObject objectToPlace; public GameObject placementIndicator; public ARRaycastManager raycastManager; private Pose placementPose; private bool placementPoseIsValid = false;
void Start() { raycastManager = FindObjectOfType(); } void Update() { UpdatePlacementPose(); UpdatePlacementIndicator(); if (placementPoseIsValid && Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) { PlaceObject(); } } private void PlaceObject() { Instantiate(objectToPlace, placementPose.position, placementPose.rotation); } private void UpdatePlacementPose() { var screenCenter = Camera.main.ViewportToScreenPoint(new Vector2(0.5f, 0.5f)); var hits = new List(); raycastManager.Raycast(screenCenter, hits, TrackableType.Planes); placementPoseIsValid = hits.Count > 0; if (placementPoseIsValid) { placementPose = hits[0].pose; var cameraForward = Camera.main.transform.forward; var cameraBearing = new Vector3(cameraForward.x, 0, cameraForward.z).normalized; placementPose.rotation = Quaternion.LookRotation(cameraBearing); } } private void UpdatePlacementIndicator() { if (placementPoseIsValid) { placementIndicator.SetActive(true); placementIndicator.transform.SetPositionAndRotation(placementPose.position, placementPose.rotation); } else { placementIndicator.SetActive(false); } } } Ask me if you have issues Catzy™ #0666
Immediately, when I add this code i get an error. var cameraForward = cameraForward.current.transform.forward; var cameraBearing = new Vector3(cameraForward.x, 0, cameraForward.z).normalized; placementPose.rotation = Quaternion.LookRotation(cameraBearing); When I erase it code builds just fine
Hi, an issue I have: When I increase the scale of the scene (minute 29:25), the placement indicator seems to position way-above the ground, and my 3D objects are now floating in the air. Any idea why? Thanks!
Assets\ARScript.cs(36,52): error CS1503: Argument 3: cannot convert from 'UnityEngine.Experimental.XR.TrackableType' to 'UnityEngine.XR.ARSubsystems.TrackableType' SOLUTION: You must remove using UnityEngine.Experimental.XR; and replace with using UnityEngine.XR.ARSubsystems;
if you get the error "The name 'TrackableType' does not exist in the current context", add using UnityEngine.XR.ARSubsystems; at the top of your code will fix it
Hi Kris, I was able to follow and successfully complete your tutorial. My question is how do I put only one airplane on the plane and then pinch-and-zoom to see the airplane bigger. Thanks!
Henry, if you look through the comments you’ll see my suggestions for how to limit placement to a single object. As for the additional functionality to resize the object interactively, others have suggested that as well so I’ll be sure to consider that for a future tutorial!
Here's the full answer for easy access... Limiting to placing a single object is not too difficult. Here's one approach... Add a new property at the top of the script to track whether the user has placed an object, and initially set it to false... private bool placementIsComplete = false; Then, in the PlaceObject() method add this line... placementIsComplete = true; Finally, in the UpdatePlacementIndicator() method, change the first line of the "if" statement to this... if (!placementIsComplete && placementPoseIsValid) This isn't necessarily the most efficient approach but it's the easiest to describe adequately in a comment. :) I hope this helps!
a complete black screen on android.........even on the cube test the app is not even prompting for camera permission..... please help its been 2 days i am stuck
Even if copy pasted the entire code, I am getting the error for "Raycast" in the line arOrigin.Raycast(screenCenter, hits, TrackableType.Planes); Please help!!!!!
The way to do this has been updated, try adding ARRaycastManager component your arOrigin and then use this instead arOrigin.GetComponent().Raycast(screenCenter, hits,UnityEngine.XR.ARSubsystems.TrackableType.Planes);
One question, so the ARKit XR package features used in your scene are basically ARKit Plugin (from bitbucket) features? Or is there a difference in terms of camera scripts, plane detection and so on?
Hi, thanks you for the tutorial but i have a several issue, when I install the plugins, I add the AR Session and the AR Session Origin but the screen is in black and it looks like the shader doesn't work properly, does anyone know how to solve it? Thanks you!
Please upload the video for android setup. The video that you uploaded has been deleted from the link. Or may be something bug. Thank you for your tutorial.
Hi, I have an error here with Raycast: arOrigin.Raycast(screenCenter, hits, TrackableType.Planes); It says: 'ARSessionOrigin' does not contain a definition for 'Raycast' and no accessible extension method 'Raycast' accepting a first argument of type 'ARSessionOrigin' could be found (are you missing a using directive or an assembly reference?) I have: using UnityEngine.XR.ARFoundation; using UnityEngine.Experimental.XR; And I use it for Android Dev. Thanks!
I've uploaded the project shown in this video to Github. The video description is updated with that link, but here it is for convenience: github.com/TheUnityWorkbench/tuw-arfoundation-demo
Thanks for sharing the project files, Kris! This was really helpful. I managed to create my Android and iOS packages following you steps. iOS version worked perfectly as you instructed. But Android version is not working. When I launch the application on my Pixel 2, it doesn't show the placement indicator and because of that plane model is no getting added. One thing I noticed which publishing android version, I get Android SDK is outdated message (SDK build tool version 28.0.1 < 28.0.3). Did I miss any step?
@@amitksood Use android studio to update SDK to the latest version.
@@amitksood try to run some plane detection code sample code, I.e. arcore based.
if it works fine than extra tunings are needed for Android :)
That's awesome mate. Tell me something. Is it possible to export the tracked data in some way? For instance, can a point cloud or a mesh be created using the tracked data so that it may be exported as an OBJ or FBX? Thanks.
Hi, I noticed that the placement indicator disappears when vertical walls are concerned, how can we update the placement indicator for vertical walls?
Really great tutorial. Professional quality and very easy to follow, job well done sir, congratulations.
Only one addendum, they changed something in ARFoundation with the Raycast.
Here are some steps to follow.
1.- Add the script to the "AR Session Origin" GameObject.
All the steps that follow are in the same script you are working in during this tutorial.
2.- Add to the top:
using UnityEngine.XR.ARSubsystems;
3.- Create a variable:
private ARRaycastManager aRRaycastManager;
4.- In the Start Method add:
aRRaycastManager = FindObjectOfType();
5.- Instead of arOrigin use aRRaycastManager
Should look like this:
aRRaycastManager.Raycast(screenCenter, hits, TrackableType.Planes);
That should cover it.
You are the sexiest man ever
Thanks!
Dude, it helped a lot thank you :)
Thanks
Thanks!!
For everyone having problems on android with the placement indicator not showing i got it working! This is what i did:
1. To your AR Session Origin gameobject add the component "ARPlaneManager". (You do not need to provide a plane prefab unless you want to visualize the detected planes)
2. In the Tracked Pose Driver component of you AR Camera change the Update Type to "Update" (The marker will still show if you omit this step but it will be super jittery)
3. Enjoy a smooth marker! :D
yes, it helped!
I see no such thing as an object called ARPlaneManager in unity
the indicator shows up but it doesn't move along when I move my camera. hmmm
@@f612CreatorsPodcast It won't be in the object list. In the inspector, click "Add Component" and search for it there.
@@jonathankaufman7168 thanks!
Very interesting tutorial and your way of explaining is really really good ! Not too fast, not too slow, pointing out interesting details, calm voice, just perfect !
Please, continue ! :)
This is the best execution of any Unity tutorial I’ve ever seen. The pacing is perfect and you ex-pained all of the concepts and needed details to both follow along and carry the knowledge forward for our own use. I’m hopeful you’ll create more in the future.
Unity should pick you up to do their official tutorials.
Would love to see one on using the various AR remote capabilities (ARKit remote, ARFoundation remote). It seems there is extremely sparse information on these and no reliable documentation on actually getting them working.
Great introduction to AR Foundation. Thanks! One word of caution to those following along, versions matter. I have found that the following component versions work to recreate this app.
AR Foundation [1.0.0-preview.22] - 2018-12-13
ARCore XR Plugin [1.0.0-preview.24] - 2018-12-13
ARKit XR Plugin [1.0.0-preview.20] - 2018-12-13
Unity 2018.3.14f1
Xcode 10.2.1 (10E1001)
macOS 10.14.6 (18G29g)
There are more recent versions of these components but this configuration seems to work best
Ethan thank you for the comment, I was beginning to think this comment section was retired.
I’ve followed this tutorial multiple times, and have tried all the fixes mentioned in the comments. I keep getting an app that loads the unity logo then becomes a black screen and never does anything beyond that. I will now follow your advice and I’ll get each exact component you mentioned. Thank you again.
@@derekgossett5887 did you find any solution to this problem?? i have same problem screen going blank
Thank you sir!
@@siddharthasapkota2219 Hi,I am a bit late but if you are still following the tutorial, which I think you won't, follow the steps to avoid a black screen:
build settings -->Player settings ->XR plugin Management-> tick the AR core checkbox
hope this will resolve your issue
Seriously thought this was from an official unity channel. Exceptionally well made tutorial! Please consider doing more videos Sir! I'm confident that view count will reach ~500k each. Could earn you a living very soon!
Definitely subbed and liked! Looking forward to more!
Solution for the problem of black background and no permission asks: Go to the player settings -> XR Plugin -> XR Plugin Management and then in iOS enable the ARKit box and the ARCore box in the Android part
Thank you for your tip - It worked!
First of all, thanks for this great tutorial, it's really well explained.
Secondly, I want to say that I had some problems with detecting the plain on my Android device, especially when switching from the floor to the table and I observed that my camera was not in focus. If someone has the same problem here is the solution I found:
Add the "AR Camera Options" component to your "Placement Indicator" and make sure the Focus Mode is Auto. The camera will always try to find a focus point and the image doesn't look blurry anymore. Hope this helps.
Daniel, thanks so much for that extremely helpful tip!
Tip to go along with this: Make sure you have updated AR Foundation to Version 1.0.0 preview-22 in order to get the "AR Camera Options" component.
ARSessionOrigin.Raycast() has been moved to ARRaycastManager.Raycast(), just use the ARRaycastManager as a new component on your AR Origin GameObject
thank you
Thank you very much!
More on this: docs.unity3d.com/Packages/com.unity.xr.arfoundation@2.0/manual/migration-guide.html
Being a novice in C+ scripting what would the code look like? I was able to add the component to the AR Origin GameObject, but was unable to adjust the script accordingly. Could you make the correct code accessible in some way?
@@maartenpex2122 arOrigin.GetComponent().Raycast(screenCenter, hits, UnityEngine.XR.ARSubsystems.TrackableType.Planes);
@@erik_natzke Hi Erik, thanks for the quick repsonse! That worked like a charm. Could you tell me why I am now not able to add the Toy plane prefab? It gives me the following when I try to add it to the scene:
Unable to instantiate prefab. Prefab may be broken.
UnityEditorInternal.InternalEditorUtility:HierarchyWindowDrag(HierarchyProperty, Boolean, HierarchyDropMode)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Your videos are exceptionally well done and explained. Also, not many other people explain the why in addition to the how. Thanks.
This was really excellent. Not only in content, but also in production quality. I can see you put a ton of time to make it so clear. Thank you.
I watched a couple of Unity & ARkit tutorials. This is one of the best! Very clear and most up-to-date with the tools.
I just subscribed to your channel.
A REALLY, REALLY, REEEEALLY SMOOTH TUTORIAL. WELL DONE!
Wooooow, the way you explained the little details and the tips are awesome.... Expecting a lot videos from you!
Holy cow... I don't have a mac or an android device so I need to wait until I have access to either of those to build to a device, but this is a fantastic tutorial. I'm already proficient in unity, but I didn't feel like you were wasting any time at all. You were really easy to follow and explained everything perfectly. Thanks!
Best Explained tutorial I ever saw on any AR related topic. Cheers !!
Long awaited tutorial! Subscribed!
Amazing, explained it very good, knows how to speak English and shows how to do everything, that earned my sub.
Thank you so much! What a great tutorial! You should put a complete course together. I would be the one to buy it. I have not seen anyone explain the coding so well. Usually they just go through it and just tell you what to write without any explanation or logic.
So glad you found it helpful and like the style, Ebrahim. I promise to make more, it's just a matter of caving out the time. Please post suggestions on any specific general or AR-specific Unity topic you're interested in seeing me cover.
@@TheUnityWorkbench Thanks! One thing that I think would be really interesting to see is how to create indoor maps also showing you on the map. Please see link for sample video: th-cam.com/video/kGkT3YKOGXU/w-d-xo.html
I'm trying to figure out how the corner map is done. I haven't been able to find any tutorials.
Very good tutorial for ARFoundation, especially for beginners. Please continue create content on ARFoundation and keep up the good work!
First of all thanks for the amazing tutorial, was really helpful. For those who were unable to see the placement indicator:
1. Device should support arcore( i have rooted redmi note 7 device which officially does not support ARcore after root everything should work fine).
2. Depending on your camera quality and lighting conditions it may take some time for indicator to appear
3. If scene is not working uncheck x86 under target architectures in player settings
4. In the new versions of AR foundation you don't need to check AR core support under XR settings
Thanks again. I am planning to create AR application using Chrome browser, hopefully you can give me some tips
Fantastic!
Finally a great ARFoundation tutorial.
Even I could follow along.
That was a better tutorial than anything I've seen for ARKit. Thanks so much
Thanks for the great tutorial! Please do more. I have never seen as good explanation as yours. It helped me a lot in my project.
most detailed Tutorial i ever watched THANK YOU SIR!!
Brilliant stuff and so well explained. Not many people have the knack of explaining things well enough but you do....👍
This tutorial was EXCELLENT! Thank you so much The Unity Workbench!
This tutorial is pure heaven, thanks for the opportunity to learn! ;)
Damn it! So good! Continue and you will have 1KK subscribers bro! Awesome!
Amazing video! Thank you for taking your time to produce an AR tutorial video of this level od quality.
Make part 2! Very good tutorial for people that have to make application on ios + android at same time!
Thanks a lot! Clear explanation. Can't wait for your new tutorials.
Wow I just learned mobile and AR with this video was struggling with the settings, thanks for the detailed and to the point veio. ENJOYED IT
Amazingly clear and well presented material. You have an amazing talent at teaching this material and presenting it in a clear and concise manner. Hope to see more!
I followed til 09:14 and I am using android device. The app opens but It never shows the cube. It asked for camera permission too, i gave it but I can't see the cube
Having the same issue!
For many of you with problems, ARFoundation have evolved a lot since this video (it is in preview after all). To be able to follow this, look at 4:17 at the versions of each Package. Try to get those specific versions of the packages in the Package Manager, by clicking the arrow beside the package name and then "See all versions". Having said that, for some reason, it only worked here with AR Foundation "preview.6 - 1.1.0", which is one version above what is shown in the video. Also, if you are using Android, there is a comment by Conviley which fixes the Indicator not showing.
Thank you so much i was about to kill myself
Sorry for the lack of respect from me. I did the tutorial and I did not use the like button to help more people to reach this good video. Thanks for sharing your knowledge
Amazing Tutorial. Keep up the good work.
At the 4:40 mark, if you don't see XR in the menu options, quit Unity and open it back up. XR should now be in the menu.
Thank you so much for this.
Very smooth and understandable.
amazing tutorial. I've watched it at least 3 times fully!
Great tutorial, you have a superb way of explaining technical stuff. Thanks.
Thanks, Robert!
Thank you so much for this tutorial. The voicing was professional and clear, which made it easy to follow. I would love to see a version of this, or a video addendum, that addresses using tracking images.
Thanks for the tutorial!
I'm following without any errors up until 09:00. After that it stops - I can't launch the first iOS build on my iPhone 7. When I try to run the iOS build from Xcode, I'm getting 76 error messages about "undefined symbols". Any ideas on what might be causing these issues?
I had the same problem and found a fix for me, it was because at the package manager in min 4:11 I installed the updated ARFoundation-Arkit-ARcore 2.0 versions, the correct versions are the 1.0 versions, if you see closely the moment he installs in the video and pause youll see the correct versions.. same answer here => forum.unity.com/threads/error-when-building-samplescene-from-arfoundation-to-iphone-6s.545338/#post-4629886
Have a problem getting the Raycasting. The compiling does not occur and throws up this error. Any help is appreciated :) .Error CS1061: 'ARSessionOrigin' does not contain a definition for 'Raycast' and no accessible extension method 'Raycast' accepting a first argument of type 'ARSessionOrigin' could be found (are you missing a using directive or an assembly reference?) (CS1061) (Assembly-CSharp)
docs.unity3d.com/Packages/com.unity.xr.arfoundation@2.0/manual/migration-guide.html#arraycastmanager
@@maushu-p1b Thanks, man.
@@maushu-p1b Thanks! I too got this issue and fixed now.
soorya Sankar I don’t know to code, can you guide me as to how you fixed the issue 😊.. noob at coding
Just replace ARSesssionOrigin with ARRayCastManager
great tutorial. short and to-the-point. million thanks!
Great explanation!
I would like many more tutorials from Unity Workbench
Amazing tutorial! I can't wait to see future videos. :)
Amazing work Kris!
This is the perfect tutorial to start with ARFoundation. We were waiting for this for a long time. Thanks. It is great. When do you plan to have more?
Wulum, I’m very anxious to do more but I’m in the midst of a big move and job change, so my free time is scarce at the moment. I hope to be getting back into video making in the next month or two.
@@TheUnityWorkbench Thanks for your honest response. Right now we're preparing a Demo of our next game using what we learned on this tutorial. We hope that soon you'll be able to create another where we can scale, rotate a scene, and Raycast Game Objects.
@@TheUnityWorkbench BTW: here you can see what we create with your tutorial. th-cam.com/video/E1cT2pL4C1w/w-d-xo.html
Thanks! what a great tutorial! perfect! I really liked the way you walk us through the code with the level of details you choose to talk about... and it also very clear that the force is strong with you!...
please do more!, especially for ARFoundation... this thing is creasy new and should have much more information about it.
Thanks for the positive feedback, Ariel! I've already got the next ARFoundation video planned and started. If you have specific questions, techniques, or challenges you'd like to see covered LMK.
@@TheUnityWorkbench you might want to update it, its outdated.
Thanks for the shadow tip. So useful.
Thank you so much. You are great at explination!!! You gave me so much information. Thank you Sir so much :).
How to Update 'Raycast' in this line of code to AR Foundation New version?
arOrigin.Raycast(screenCenter, hits, TrackableType.Planes);
One of the best tutorial so far!!
Great tutorial, thank you so much! Please, consider make some more of this :)
For people having problem with the placement indicator being stuck, not moving, or rotating. What you need to do is add the following components to your AR Session Origin:
-AR Raycast Manager (Sript)
-AR Plane Manager (Script)
Hope this helps
Thank you this worked for me!
Thanks!
The quality of this video and your explanation are really top level, if you have an online course or any pay material, please let me know because you have buyer on me!
Hi, I did all the steps of the tutorial. When I run the app on the android mobile to show the cube this works fine, but when I continue with the tutorial making the changes to show the Placement Indicator, when running the app the Placement Indicator is not visible on any surface. I am using Windows 10, Unity 2018.1.7 and ARCore.
Luis, I'll look into this when I can find some time. It might be a couple weeks, though (sorry!). Can you try this with 2018.3 and see if you get different results? (That's the version I used for the tutorial.)
@@TheUnityWorkbench hi, i have the same problem with unity 2018.3
appear same problem too.... so i try to solve this problem to revise 'TrackableType.plane -> TrackableType.FeaturePoint'. this solution is a temporary measure. this link show how to operate th-cam.com/video/cuWEoh7PFTQ/w-d-xo.html
i am using widows10, unity 2018.3 and ARcore
If you add the ARPlaneManager component to the AR Session Origin gameobject the marker will appear. However, it does not perform as smooth as in the video and i'm not sure why. According to the scripting API: "When [ARPlaneManager component is] enabled, this component subscribes to planeAdded, planeUpdated, and planeRemoved. If this component is disabled, and there are no other subscribers to those events, plane detection will be disabled on the device." So it seems like you have to have the ARPlaneManager or at least something else subscribing to those events to get plane detection to enable.
using Unity 2018.3.3f1
I got it working! This is what i did:
1. To your AR Session Origin gameobject add the component "ARPlaneManager". (You do not need to provide a plane prefab unless you want to visualize the detected planes)
2. In the Tracked Pose Driver component of you AR Camera change the Update Type to "Update" (The marker will still show if you omit this step but it will be super jittrey)
3. Enjoy a smooth marker! :D
Thank you so much for making this tutorial.
Super cool tutorial! Thanks a lot! More of this stuff would be great :)
Very interesting tutorial! Thanks for sharing with us!
In android,the placement indicator is being shown at the start,but it just stays there and does not move along with the camera. any idea why ?
And also the cube is not being placed on the click.
I have the same issue so if someone could help with this it would be greatly appreciated
Add or require an ar raycast manager to the arr session origin if you are using unity 2019.2
And also a plane manager i think in the ar session origin
@@ashashi yeah you need to add it xd
@@markandre8786 thank you so much
Does it count if I keep pressing the like button over and over again???
Great tutorial, this single tutorial answered all my questions I had. I was ready to search for multiple videos to get all my answers, but this first video answered all of them!!
great video, enjoyed a lot. clear explanation thanks!
Thanks for the great tutorial 👍 One of the best AR Tutorial.
Very useful, well thought out and organised tutorial. Really appreciate the upload sir. Thank you.
Edit: Why aren't you uploading anymore?
Successfully installed on IOS 12.3.1 iphone 8, using mac pro 2013, mojave, unity 2018.4.3f1, xcode 10.2.1, ARfoundation 1.0.0-preview.22, ARCore XR plugin 1.0.0-preview.24, ARKit 1.0.0-preview.20, (I bought the apple developer program, dont know if it was necesary).. successfully installed on android 8.0, Samsung S7 edge.. failed to install on huawei 30prolite cause it doesnt support ARCore, maybe with vuforia, I suppose.
Is important to say that in the minute 14:36 when he choose "auto generate the method", a new "using system" library is created at the top of the script, and he didnt mention it, in orden to achieve the touch input is necesary to insert that library.
Thanks for the tutorial. Interesting way to use scene's scale to shrink the object, instead of making objects smaller.. I will retype the code, when I will have a time :)
amazing tutorial.. thanks a lot.would be really cool to see some UI tutorials in the future.
I'm just starting off with AR I'd appreciate any help i can get. I deployed the app to my iPhone from Xcode but all i get is a black screen. How can i fix that?
How to Update 'Raycast' in this line of code to AR Foundation New version?
arOrigin.Raycast(screenCenter, hits, TrackableType.Planes);
Help, in the min. 6:56 I do not get the Samsung G950F option, how do I add that feature?
install andriod sdk
Great basic tutorial... Very easy to follow...
ARSessionOrigin is not exposing the Raycast method anymore. What should we use instead?
same problem.
Use ARRaycastManager instead of ARSessionOrigin
If you're wondering how to test and debug AR features in Unity Editor, here is a plugin I wrote for this purpose.
I hope it will save someone hours of compilation time after every minor change.
AR Foundation Editor Remote:
forum.unity.com/threads/ar-foundation-editor-remote-test-and-debug-your-ar-project-in-the-editor.898433/
That was an awesome tutorial! Thanks!
Please make it as a series.
Greate tut!
For everyone having issues with Unity 2019.2.0f1 and ARCore - ARFoundation 2.2.0 on Android here is a working code
you will also need to add an AR Raycast Manager, an AR Plane manager with empty prefab and an AR Point Cloud manager with an empty prefab too like
Conviley said in your AR Session Origin object
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.ARSubsystems;
public class ARTapToPlaceObject : MonoBehaviour
{
public GameObject objectToPlace;
public GameObject placementIndicator;
public ARRaycastManager raycastManager;
private Pose placementPose;
private bool placementPoseIsValid = false;
void Start()
{
raycastManager = FindObjectOfType();
}
void Update()
{
UpdatePlacementPose();
UpdatePlacementIndicator();
if (placementPoseIsValid && Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
{
PlaceObject();
}
}
private void PlaceObject()
{
Instantiate(objectToPlace, placementPose.position, placementPose.rotation);
}
private void UpdatePlacementPose()
{
var screenCenter = Camera.main.ViewportToScreenPoint(new Vector2(0.5f, 0.5f));
var hits = new List();
raycastManager.Raycast(screenCenter, hits, TrackableType.Planes);
placementPoseIsValid = hits.Count > 0;
if (placementPoseIsValid)
{
placementPose = hits[0].pose;
var cameraForward = Camera.main.transform.forward;
var cameraBearing = new Vector3(cameraForward.x, 0, cameraForward.z).normalized;
placementPose.rotation = Quaternion.LookRotation(cameraBearing);
}
}
private void UpdatePlacementIndicator()
{
if (placementPoseIsValid)
{
placementIndicator.SetActive(true);
placementIndicator.transform.SetPositionAndRotation(placementPose.position, placementPose.rotation);
}
else
{
placementIndicator.SetActive(false);
}
}
}
Ask me if you have issues Catzy™
#0666
Placement Indicator is unfortunately still staying in place for me. Using 2019.2 latest versions.
When it runs it seems to take a long time recognizing the floor. I'm still placing cubes but they are in mid-air and not on the floor.
Immediately, when I add this code i get an error. var cameraForward = cameraForward.current.transform.forward;
var cameraBearing = new Vector3(cameraForward.x, 0, cameraForward.z).normalized;
placementPose.rotation = Quaternion.LookRotation(cameraBearing); When I erase it code builds just fine
Hi, an issue I have: When I increase the scale of the scene (minute 29:25), the placement indicator seems to position way-above the ground, and my 3D objects are now floating in the air. Any idea why? Thanks!
Ori, I'm not sure why that would be. Check to make sure that the Quad nested inside your Placement Indicator object is positioned at 0, 0, 0.
when i build and run the project with that cube only it is showing only a black screen.
i have a problem when i open app in my android device. "this application requires the latest version of ARCore", please help me. Thanks
You. explain everything sooo good.. thanks soo much..
Assets\ARScript.cs(36,52): error CS1503: Argument 3: cannot convert from 'UnityEngine.Experimental.XR.TrackableType' to 'UnityEngine.XR.ARSubsystems.TrackableType'
SOLUTION: You must remove using UnityEngine.Experimental.XR; and replace with using UnityEngine.XR.ARSubsystems;
Thanks man, good help :)
Great Tutorial. Well done! 👍🤓
if you get the error "The name 'TrackableType' does not exist in the current context", add using UnityEngine.XR.ARSubsystems; at the top of your code will fix it
Hi Kris,
I was able to follow and successfully complete your tutorial.
My question is how do I put only one airplane on the plane and then pinch-and-zoom to see the airplane bigger.
Thanks!
Henry, if you look through the comments you’ll see my suggestions for how to limit placement to a single object. As for the additional functionality to resize the object interactively, others have suggested that as well so I’ll be sure to consider that for a future tutorial!
Here's the full answer for easy access...
Limiting to placing a single object is not too difficult. Here's one approach...
Add a new property at the top of the script to track whether the user has placed an object, and initially set it to false...
private bool placementIsComplete = false;
Then, in the PlaceObject() method add this line...
placementIsComplete = true;
Finally, in the UpdatePlacementIndicator() method, change the first line of the "if" statement to this...
if (!placementIsComplete && placementPoseIsValid)
This isn't necessarily the most efficient approach but it's the easiest to describe adequately in a comment. :) I hope this helps!
a complete black screen on android.........even on the cube test
the app is not even prompting for camera permission.....
please help its been 2 days i am stuck
Even if copy pasted the entire code, I am getting the error for "Raycast" in the line arOrigin.Raycast(screenCenter, hits, TrackableType.Planes);
Please help!!!!!
The way to do this has been updated, try adding ARRaycastManager component your arOrigin
and then use this instead
arOrigin.GetComponent().Raycast(screenCenter, hits,UnityEngine.XR.ARSubsystems.TrackableType.Planes);
One question, so the ARKit XR package features used in your scene are basically ARKit Plugin (from bitbucket) features? Or is there a difference in terms of camera scripts, plane detection and so on?
Hi, thanks you for the tutorial but i have a several issue, when I install the plugins, I add the AR Session and the AR Session Origin but the screen is in black and it looks like the shader doesn't work properly, does anyone know how to solve it?
Thanks you!
yep, this is outdated, code is also wrong now. You will get stuck around 15:00 when you start the raycast.
That was awesome, thank you so much 👍🏼
Anyone else have the problem that the model instantiates to air? Not on the surface? How to fix this?
Your video making is so nice that i wanna hug you. Respect from me sir.
I still missing the arOrigin.Raycast and TrackableType.Planes, need help! all 3 plugins are installed
Please upload the video for android setup. The video that you uploaded has been deleted from the link. Or may be something bug.
Thank you for your tutorial.
Hi, I have an error here with Raycast:
arOrigin.Raycast(screenCenter, hits, TrackableType.Planes);
It says: 'ARSessionOrigin' does not contain a definition for 'Raycast' and no accessible extension method 'Raycast' accepting a first argument of type 'ARSessionOrigin' could be found (are you missing a using directive or an assembly reference?)
I have:
using UnityEngine.XR.ARFoundation;
using UnityEngine.Experimental.XR;
And I use it for Android Dev.
Thanks!
plz let me know when you solved the problem......got exactly the same problem right now....
The same for me :-(
You have to use the 2018.3 version of Unity, In packageManager ARfoundation, ARkit and ARcore 1.0.0
docs.unity3d.com/Packages/com.unity.xr.arfoundation@2.0/manual/migration-guide.html#arraycastmanager
@@siteli717 Ok, see below the heroes :D
Wow! really good. Thanks for sharing
my script dosen't work. i followed every single step
(Assets\demo\ARTapToPlaceObject.cs(60,6): error CS1513: } expected