Unity AR Foundation Tutorial: Filtered Planes (1/2)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right after finishing this chapter you will have mastered the filter plane feature so you will be able to filter through vertical horizontal big planes small planes whatever you need which is very useful since you can use those as your prerequisite for your a application which is very commonly used and very helpful and yeah let's get started with the videos enjoy since many of my students have asked how exactly it's possible to have filters around the plane detection so for example you want to filter through vertical and horizontal plane which is something that we are doing in the app on my course already but then you want to also filter through the size all of that stuff this is what the video is about but first of all as always welcome to this channel if you are new here this channel is all about growing in the ar vr industry so if you want to know how to basically code how to create an amazing ui for arvr sound all of that good old stuff will be covered on this channel and if you are serious about it then definitely check out my website but let's get started with the video therefore let's open unity hub and then create a new project in this video and i would highly recommend you to use the same versions on the unity and air foundation as well so here we are using the current up-to-date version 2019.416 which is the lts and yeah in here we want to create a 3d template and here we can just call it let's just call it filtered planes something like this it's okay and then of course where you want to save it over here and then create and i see you back in unity so now we have a fresh unity project and as always we have to set it up for aya development i have a complete video series on setting up your project for yeah ar foundation all of that google stuff will be of course linked in the description below but yeah first of all we have to go to file build settings and then in here we want to go to android or ios depending on your platform so if you want to build for android with ar core then of course we'll go to android otherwise for ar kit and the iphone and ipad and so on you will go to ios over here then we switch a platform and yeah that will take a minute or two there we are we are now set up for android and then yeah let's first of all add the open scene so we have it when we build it and now we need to go to player settings over here and then in here we have some settings we have to do therefore we can go to other settings over here make sure we have the player selected and then other settings first of all we can get rid of vulcan okay shouldn't take too long and then multithread rendering off for android and again the in-depth tutorial for ios will be linked here in case you are working with the iphone or ipads then you can check out this video uh let me just see and now we have to change the package name to something special could be anything it doesn't really matter immersive insiders and then yeah filtered planes and then the last thing is minimum api level has to be on 6 26 let me see over here because this is the minimum level which is required for air cord works well and also make sure that you have installed android studio if you haven't then you can download it over here so download android studio i have it already that's the version that i'm using in this tutorial as well just download it and install it and then you're good to go lingua as always will be in the description below so now we can close this one already and this one as well and we have to import ar core and maya foundation so therefore we go to window and then package manager and this takes a little while to load or just a couple seconds really here we see it loading packages and there we go now it's done loading so here we are if we scroll up and go to ar foundation there we see it we have all the versions in here that we can select from in the course that i have built we are using the version 2.1.8 which is here verified for the versions with the unity and the af studio for example all of that stuff just works so i will highly recommend you first to take this one as well otherwise you might have some errors and problems and it does not work and then if you have tried it and succeeded with this version as well then feel free to upgrade to anything else really so there we are now we have this air foundation installed and now we have to go to ar core or air kit depending on what platform you are working on and in here we don't want to have the 2.1.12 because i had some issues with this version as well so i would just take it as well from the tutorial here or for my course really 2.1.11 and let me install it let me just make sure it's the correct one yes it is install and now the final thing we have to do is we have to go to file build settings and then in here with the player settings again and down here we have the xr and ar core and we can create our serialized instance here for so now we have ar core required and then here we can just see plugin providers we have the error code as well and now we are good to go let's finally start to do something yeah which is not setting up close this one here and now we can get rid of the main camera and we can right click and then we have this xr field now if we right click on the hierarchy and now we have to add the ar session origin and also a ar session so this is a basic setup for any kind of ar project yeah camera we don't have to do it but i just like to have this one as the main camera so whenever someone is using this one it just finds it very fast and yeah that's it for really just let's also just add a cube so we it's not so boring and we see something when we are test building it and there we go so yeah just put it in front of you if you just leave it by default you are actually inside of the cube and you don't see it so make sure you are moving it up to the front a little bit and then um yeah the scaling is just so it doesn't look so boring here as well hit ctrl s and now we can go to file build settings make a test build and all of that stuff which is explained in my previous videos already so i don't have to do it again because then we can save some time and get started with the actual plane detection so what we want to do is here we want to create a canvas ui canvas over here let me just see there we go and we want to be able to figure out if we have found a vertical a horizontal and then just for the sake of it a big plane so then we have like three filters we can choose from and once when all three are met then we can actually um proceed to the actual game or something like this i mean hopefully you are more creative here because this is really like just a demonstration so now we have our panel here we can just give it here some kind of landscape value doesn't really matter too much of course you can put your actual phone metrics in here as well if you know the pixels for whatever phone you have for example but i mean this is fine for the one that i'm using i just unlocked the view so i can actually move around in 3d space and now we have our canvas the panel and in here we want to have three toggles so ui uh toggle there we go and now we see it's very very very small because if you have a kind of like good phone already which has a decent amount of um pixel rates over here then it will be very small so we can already scale it up a bit like this that's not too bad and we see the toggle looks kind of ugly um the font like it looks really like um pixelated let me just go here does not look too nice and therefore we can just get rid of the label and we add another one which is not the default one but it is a text mesh so text text mesh pro you have to just import the tmp essentials and this will make the thing just a lot more beautiful don't worry if you get an error like this that's just like redrawing the editor and now we can close it and we see this is crisp and clear let's position it a little bit it's way too big uh okay i think that's not too bad something like this and here we would say for example vertical plane found okay i just realized while editing that i've been writing vertical wrong throughout the whole video i'm super sorry it's kind of a shame but uh just ignore it for yeah whenever you see me writing vertical pretty bad um yeah sorry for that and let's move on and we see already it's some too small so you can just yeah hit z a t with q w e and r you can change those things over here and yeah t is the one for sizing it up and we see a vertical plane found it's a little bit too big so i think that's fine now just move it to the side and then yeah vertical plane that is fine and now we can just make two more so this one goes here and this one goes here yeah obviously this is not to be like very pretty it's more on the coding part which is going to come in a minute horizontal plane and now we have our um what is again big plane so i want to see if we found at least one vertical one horizontal and one big plane and then whatever kind of game you have you can start it or app really ui button text mesh pro and we see a very small button which we can now size up a little bit that's not too bad there we go this one has a texture pro already oh let's just call it start yeah i think that looks not too bad and then just to keep things um clean and tidy and nice we won't have a title as well ui text mesh pro and then this is really like it play so just like a basic basic basic ui really here and now we can disable or uncheck them because of course they will be checked when yeah the unity or your phone faints finds a plane and the button will only be interactable once all three are checked this is the main logic that we want to build and now since we are done with the ui we can already get started with the plane detection and yeah first of all we have to add the ar plane manager which is provided by unity already in here very simple this does most of the job already for detecting basic planes and then we want to write some custom scripts that do yeah subscribe to methods by like when planes are changed and stuff like this and they will communicate with the ui which will then set enable our yeah the buttons the toggles over here and then the button in the end as well to have a nice visualized plane i will first of all import a nice package which is also provided by unity which is the ar feather plane which you can see in the ar foundation sample project exactly but again this will be linked in the description below so feel free to check it out i will hit import now and it should be not taking too long there we go and yeah just ui refresh and here now we have our prefabs ar feather plane and this will go into our plane prefab there we go and now ctrl s to save and now our basic plane detection is already set up so if you now build a project on file build settings and then build and run with your phone connected then you should see something really cool already i mean not really cool but very simple but it still looks cool so now we can see our canvas nothing special we have definitely have to change the names and here we go we see our plane so this is how it looks from the unity for that planes much better than the default one with just the line renderer you can see our horizontal plane vertically works as well and now let's get into the filtering so first of course we can here change the text over here so horizontal plane and now we also have the correct text in here but for now this is it for the video otherwise yeah the video will just be way too long it will be about 40 minutes and i know most people don't uh nowadays have attention for 40 minutes of coding so this is why i will split up the video in two parts and the next part don't worry will come out just in a few days so no worries there and yeah thank you for listening as always if you have any questions leave them in the comments below and yeah see you in the next one you
Info
Channel: Dinesh Punni
Views: 11,753
Rating: undefined out of 5
Keywords: unity ar foundation, unity ar foundation plane detection, unity ar foundation tutorial, ar foundation, unity ar, ar foundation basics, ar foundation unity, unity ar tutorial, plane detection ar foundation, ar unity, unity augmented reality, arcore unity, ar development, ar foundation plane manager, dinesh, unity xr, ar foundation unity tutorial, ar foundation tutorial, arfoundation, augmented reality tutorial, arcore tutorial, augmented reality unity, augmented reality
Id: pBEGvd2akTY
Channel Id: undefined
Length: 14min 35sec (875 seconds)
Published: Mon Dec 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.