Unity AR Foundation Tutorial - Tap to Place Objects in AR

  Рет қаралды 92,022

Dinesh Punni

Dinesh Punni

Күн бұрын

Join our in-person XR Hackathon in Berlin and win up to $25k in funding and prizes 👉🏽: www.xrcc.events/
Want to build a fulfilling and well paid career in AR/VR (Spatial Computing)? 👀
Our best tips, strategies, and secrets from teaching AR and VR since 2016 - everything distilled in one Free Course 👉🏽: bit.ly/48MBgT0
Our AR/VR Education Platform offers
✔️ AR/VR Courses
✔️ Private Discord community
✔️ Expert Q&A Hangouts
✔️ and much more
learn.immersive-insiders.com/
How to create Augmented Reality Apps using Unity AR Foundation?
In this Beginner-friendly Unity AR tutorial series, you'll learn how to create amazing AR Apps for your iOS and Android phones. (ARKit + ARCore)
This Unity AR Foundation place objects in AR tutorial will teach you how to use ar foundation to use touch input to place virtual objects in your AR scene.
Check out this Unity AR Tutorial for beginners playlist here (AR Foundation Basics):
• Unity & AR Foundation
🔔Subscribe to our channel to get started in AR/VR for Development, Business, Design, and much, much more: 👉 / @dineshpunni
🔻Let's connect!
Website: www.dineshpunni.com/
LinkedIn: / dineshpunni
Instagram: @dinesh.punni
🔻Let's collaborate!
If you have any questions leave them in the comments below,
for business inquiries contact me via e-mail: dinesh@dineshpunni.com

Пікірлер: 199
@DineshPunni
@DineshPunni 3 жыл бұрын
To all aspiring Creators in the AR/VR field! Join our amazing XR Creators Discord server to meet and connect to like-minded people. We have a lot of amazing people (Devs, Designers, Businesses, etc.) helping each other there already. The Server is completely free, so join and introduce yourself! :) discord.gg/9RqT4cv6Pa
@antondoesfood8532
@antondoesfood8532 4 жыл бұрын
Finally someone with up-to-date tutorials for AR Foundation. Can't wait for more!
@DineshPunni
@DineshPunni 4 жыл бұрын
Thank you for your kind words, unfortunately only up-to-date for some weeks, then it will be depricated again 😂But thanks for your comment :)
@misterr3083
@misterr3083 3 жыл бұрын
@@DineshPunni Hiya Dinesh, no still valid! I just followed along for iOS 14.2 and all works perfectly!!! Thanks so much you are my AR hero!
@DineshPunni
@DineshPunni 3 жыл бұрын
@@misterr3083 Thanks for the kind words :) That's great to hear 😎
@seve8138
@seve8138 3 жыл бұрын
I was looking for official tutorials - nothing, just the initial setup. I'm so thankful you demonstrate all the basics of it.
@DineshPunni
@DineshPunni 3 жыл бұрын
Thanks man! If you have any questions feel free to let us know :)
@sharpeyyy
@sharpeyyy 7 ай бұрын
Hey man! You've probably forgotten all about this video by now but I just had to say thank you so much - I've been looking for this exact solution for WEEKS now for my school project, and I was sure that I was going to get an awful grade if I couldn't figure it out. You've probably saved my grade and a great deal of stress, so thank you for making the only relevant AR tutorial video I could find on all of KZbin :)
@TheTrickster182
@TheTrickster182 4 жыл бұрын
OMFG thank you! i have been looking for a tutorial that actually works for like two days. Can you please do more AR tutorials?
@HeadPack
@HeadPack 4 жыл бұрын
Awesome. I hope you continue this series and keep it updated. There are very few tutorials out there covering the new ARFoundation. Older ones often present code that doesn't work on newer Unity/ARFoundation versions.
@DineshPunni
@DineshPunni 4 жыл бұрын
Thanks for the kind words, unfortunately even this will be depricated within a couple weeks 😂 but thanks for the comment
@joeblowers8539
@joeblowers8539 4 жыл бұрын
Great tutorial!
@TravelWithDhami
@TravelWithDhami 4 жыл бұрын
Man, these are gems! all you need is a bit loud audio and all this is good to go.
@DineshPunni
@DineshPunni 4 жыл бұрын
Thanks for the kind words man :) Yeah, I had some struggles with my microphone but it should be better now.
@cristopherwibowo6846
@cristopherwibowo6846 4 жыл бұрын
Hi , I like your tutorials. its works. i will try another tutorials. Thanks.
@UjjwalDubey1994
@UjjwalDubey1994 3 жыл бұрын
Thank you so much!
@DineshPunni
@DineshPunni 3 жыл бұрын
Glad it helped! :)
@AlexJazzEEk
@AlexJazzEEk 4 жыл бұрын
Thanks for awesome tutorials! Please make more for AR Foundation
@DineshPunni
@DineshPunni 4 жыл бұрын
More to come! And thanks for your kind words :)
@AdrenChong
@AdrenChong 4 жыл бұрын
This tutorial is awesome, watched all of em. But I wonder, is possible for ARCore cloud anchor ? It would be super useful to have such tutorial
@biancadragomir
@biancadragomir 3 жыл бұрын
Great tutorial, thanks a lot!
@DineshPunni
@DineshPunni 3 жыл бұрын
Happy to help :)
@muhammadumairqaisar9517
@muhammadumairqaisar9517 4 жыл бұрын
Great Work!! Best Video series I have ever watched . Thank you So much..
@DineshPunni
@DineshPunni 4 жыл бұрын
Thank‘s a lot for the kind words. I‘m glad I could help you out. This keeps me that motivated :)
@willwang9840
@willwang9840 4 жыл бұрын
@@DineshPunni I found this series very helpful. Looking forwards to more!
@yoshitsugukosaka5647
@yoshitsugukosaka5647 4 жыл бұрын
Umair Qaisar good tutorial! have a question for you! I have a list of prefabs I want to place one at a time. How would you load prefabs using ui objects like buttons or a dropdown?
@sachibro6838
@sachibro6838 3 жыл бұрын
best app evar
@skudgee2
@skudgee2 3 жыл бұрын
This is good stuff
@MitchTheMarine
@MitchTheMarine 4 жыл бұрын
Loving these thank you! I'm not sure if it shifts, but when you're teaching code, if you could try and keep it as centered as possible on the screen it'd really help, other than that thank you!!
@DineshPunni
@DineshPunni 4 жыл бұрын
Thanks for the feedback Blalien. What exactly do you mean by that tough?
@MitchTheMarine
@MitchTheMarine 4 жыл бұрын
@@DineshPunni Sometimes when you're working on sections of code you're at the very bottom of the screen to the point the timeline of the video can block it out. Just puts a barrier up every now and then, not a huge deal, it'd just be more accessible screen center.
@bruceb85
@bruceb85 3 жыл бұрын
I have an imported asset (3d model from Revit) when I place it on the plane the view jumps back to the game view scene?
@surajnair2617
@surajnair2617 4 жыл бұрын
Awesome tutorial Dinesh. I like how each of them are self contained and small enough to get something basic working. Its satisfying to learn this way. Did you pull out your game Super Walljump from the play store.
@DineshPunni
@DineshPunni 4 жыл бұрын
Thanks a lot Suraj! This is some truly helpful feedback. Highly appreciate it! I'm glad you like the style of the videos. I never liked that many tutorials go like 35mins and start somewhere 5 videos ago 😅 Glad that this format is welcome here :)
@DineshPunni
@DineshPunni 4 жыл бұрын
My game Super Walljump is not on the Play/App store anymore unfortunately. There it too much maintainance needed to keep apps in those stores 😅
@jonasharrison6355
@jonasharrison6355 2 жыл бұрын
Hey any advice on what to do if I want to be able to place an object in the environment ONLY AFTER I have pressed a button on screen? Currently working on something that uses this as the code to place an object in the environment, but right now my screen turns green after I select the button.
@helloworld3003
@helloworld3003 2 жыл бұрын
thanks for this amazing tutorial , can you please make a tutorial on if you create a UI and have like scrollbar or like a button that opens a list with items in it and when we click we spawn that item ,,also store those 3d models in a database , show us how pleaseeeeeee ,,, thanks in advance :)
@jessicaoreilly9260
@jessicaoreilly9260 4 жыл бұрын
Thank you for the tutorial, I have learned a lot. Can you do a tutorial on rotating the object?
@DineshPunni
@DineshPunni 4 жыл бұрын
Hey, thank you for the feedback :) Try out this asset from the assetstore. That makes Touch Input very easy. assetstore.unity.com/packages/tools/input-management/lean-touch-30111
@TehEccentricKid
@TehEccentricKid 3 жыл бұрын
Is it possible to test AR with the quest 2? I know it sort of has AR, although I don't think it was developed for it specifically
@alexfaure6031
@alexfaure6031 4 жыл бұрын
Hi, how to delete precedent object for having just one by one objet ? tks !!
@ashmitag4022
@ashmitag4022 3 жыл бұрын
Hi Dinesh, firstly I wanted to know how I can permanently place the cube on the plane. Secondly, how do I import the plane detected via my phone onto my laptop, so that I can place the cubes on the plane, so that the next time I project the scene on my phone, the cubes would be there permanently? Your help would be greatly appreciated. Thank you.
@1234yokee
@1234yokee 3 жыл бұрын
Excellent tutorials sir..but how to put camera shutter button for take a photo or save a photo..any tutorials? pls sir
@boukman746
@boukman746 4 жыл бұрын
I have followed all of the steps, and it works with regular 3D objects like cubes, but when I try to use my custom fbx models, it doesnt appear. What can I do to make sure that my models appear on the plane.
@TheSoullied
@TheSoullied 4 жыл бұрын
thank you from Russia!
@DineshPunni
@DineshPunni 4 жыл бұрын
Thank you too!
@roslim0848
@roslim0848 2 жыл бұрын
if i want to make if for spawning a list of many different object, do i just add the "taptoplaceobject" Csharp script inside each button of the list items?, instead of inside the AR session origin, can it work?
@guillaumepalacios7511
@guillaumepalacios7511 4 жыл бұрын
Thanks Dinesh for a great set of tutorials on AR Foundation. Question: can we do all of this using the Universal Rendering Pipeline? Thanks for your answer.
@DineshPunni
@DineshPunni 4 жыл бұрын
Hey, as far as i know it should be possible now. When i created the video they were still struggling a bit but i would say just try it out :)
@DineshPunni
@DineshPunni 4 жыл бұрын
It would be sad if it‘s still not working
@xiaocao1866
@xiaocao1866 4 жыл бұрын
thank you for the tutorial..it is amazing and easy to follow..hope you will teach about how to use vuforia too..to do a simple app's interface with button and can be view the 3d model by option of button maybe..
@DineshPunni
@DineshPunni 4 жыл бұрын
Thanks for the kind words :) At the moment I don't work with Vuforia but there will be future videos and series, where I'll also do AR tutorials on simple Apps in Unity
@xiaocao1866
@xiaocao1866 4 жыл бұрын
Dinesh Punni I’ll be waiting too! Makes me anticipate your tutorial👏👏👏
@germanyyoutube573
@germanyyoutube573 4 жыл бұрын
Vree niceee 😊
@DineshPunni
@DineshPunni 4 жыл бұрын
Thanks!
@aarons4078
@aarons4078 Жыл бұрын
The plane detection is working for me, but the script to spawn/place an object doesn't seem to be working on ios. That said, I'm not getting any errors in my unity editor. Any guidance would be greatly appreciated!
@madpccapel
@madpccapel 4 жыл бұрын
please make a video to put masks on android, thank you very much and new subscriber
@trumanboone5395
@trumanboone5395 4 жыл бұрын
Great video! Have you done anything with two finger rotation or scaling of objects?
@DineshPunni
@DineshPunni 4 жыл бұрын
Thanks for the feedback :) Yes, however, that works independent of AR Founation. There are lots of great (and free) tools for touch input in the Unity Assetstore. I may do a video in the future about that.
@professorm4171
@professorm4171 4 жыл бұрын
If you have a model more complicated than a cube (with textures, etc) , you'll run into memory issues that'll cause temporary freezing. You need to use Addressables.InstantiateAsync() for better performance.
@DineshPunni
@DineshPunni 4 жыл бұрын
But that does not happen with only one instantiated object right? It also worked for multiple mid-high poly objects so far. But you're right, using Addressables it better for performance. I might do a video on that topic in the future. Thank's for your comment
@professorm4171
@professorm4171 4 жыл бұрын
@@DineshPunni I think it's the model texture has a lot to do with it. Adding a texture in memory during runtime could slow things down. But I do instantiate multiple models at runtime and see the bad performance.
@DineshPunni
@DineshPunni 4 жыл бұрын
@@professorm4171 hmm interesting. It could be that your phone is the bottle neck there. Usually you don't have performance issues so fast, unless you have extreme high poly count and high resolution textures.
@professorm4171
@professorm4171 4 жыл бұрын
@@DineshPunni I'm on iOS and seeing overall performance issues. I guess Unity needs to finalize ARFoundation.
@DineshPunni
@DineshPunni 4 жыл бұрын
@@professorm4171 Yeah, can't agree more on that. Fortunately they keep pushing updates very regulary. And with every update it get's more stable.
@tanmaysinghal8370
@tanmaysinghal8370 3 жыл бұрын
BRo please create a tutorial on measurement app using ar from scratch
@atruefreethinker1944
@atruefreethinker1944 4 жыл бұрын
Nice vids. I do have a question. Your cube is placed half below and half above your translucent white foundation indicator. If I wanted to place it on top, but it could be of some random size, how would that be done?
@akash_the_phenomenal942
@akash_the_phenomenal942 Жыл бұрын
Did you figured it out ? please explain me
@brolinfernandes1647
@brolinfernandes1647 3 жыл бұрын
Great tutorials, good pace to it too. Doubt: When I place a certain object on vertical surfaces, the orientation of it is all messed up. Any suggestions on how to snap it straight on the wall?
@DineshPunni
@DineshPunni 3 жыл бұрын
Good question, I'm teaching this in my AR Foundation course. You can set the transform.forward of your object to the plane.normal and then it should be fitting well.
@lighttv6255
@lighttv6255 3 жыл бұрын
Hello sir @Dinesh Punni im trying to this but whenever i click there is no object being place can you explain it to me please
@DungPham-xe3wz
@DungPham-xe3wz 2 жыл бұрын
thank for your video. how can i touch to prefab, then show information ?
@DineshPunni
@DineshPunni 2 жыл бұрын
Instead of moving the object when touching you can invoke an Unity event that (for example) opens up a UI with Information
@seve8138
@seve8138 3 жыл бұрын
Hello Dinesh, thanks again for your awesome tuts. Can I ask what you're using for Play-time Android testing? Remote doesn't seem to work for AR...
@DineshPunni
@DineshPunni 3 жыл бұрын
For the last projects I had with ARFoundation I usually prototyped most of the app in the editor. Unity is still working for the AR remote support. There is an asset on the Unity assetstore but it doesn’t stream the camera image. Maybe it could be useful to you. If you can’t find it let me know and I‘ll look up the link for you :)
@seve8138
@seve8138 3 жыл бұрын
@@DineshPunni The only one I found is this one but it's 71€. Was yours free? assetstore.unity.com/packages/tools/utilities/ar-foundation-editor-remote-168773
@MEBAkhila
@MEBAkhila Жыл бұрын
How to connect more scenes together in object tracking AR
@akash_the_phenomenal942
@akash_the_phenomenal942 Жыл бұрын
I want to instantiate the cube on the floor of my rrom , but it is detecting plane half way up from the room and placing the cube there, Please help. Thank you
@juancarlosmarinfajardo8196
@juancarlosmarinfajardo8196 4 жыл бұрын
Thanks for this tutorial, if I want to just place the object in my first touch position and just leave it there even if I continue touching the screen, how can I do it?, Is because I need to place an object, leave it there and interact with the object, (ex. I touch a door´s car and it opens), but I just need to leave the object in the first touch position
@ivanho521_
@ivanho521_ 4 жыл бұрын
modify the Update() function if (spawedObject == null) { //First Touch and create the object } else { //Touch after the object is already created }
@arjunm1246
@arjunm1246 Жыл бұрын
Hi when I create the bool TryGetTouchPosition(arguments) it says 2 errors 1. CS0177 :The out parameter 'touchPosition' must be assigned to before control leaves the current method 2.CS0161 'ArObjectDetection.TryGetTouchPosition(out Vector2)': not all code paths return a value
@dono__ft6671
@dono__ft6671 2 жыл бұрын
How can we do for multiple objects ?
@riven_drea
@riven_drea 2 жыл бұрын
The best overload for 'GetTouch' does not have a parameter named 'Index'. is there any clue for this problem ?
@domib5401
@domib5401 4 жыл бұрын
Hi, Thanks for the tutorial. I am pretty new to unity and using ar foundation. So i have one question, what would be the best way to spawn many objects but still being able to interact with the already placed objects?
@DineshPunni
@DineshPunni 4 жыл бұрын
That's a good question. One way would be shooting an AR Raycast on each object to detect if you hit a cube to activate it
@ZoneInOn
@ZoneInOn 4 жыл бұрын
@@dis5166 me too, i really want to be able to spawn multiple different objects and interact with all.
@emersonbrinks7200
@emersonbrinks7200 4 жыл бұрын
is there a reason that you make a private vector2 touchposition at the start of of the script when you keep adding new local vector2 touchpositions and using those?
@SethSScott-li6vr
@SethSScott-li6vr 4 жыл бұрын
yes, i am seeing errors even in the video with the underlines.....also, mine is nott registering the raycasts it seems
@moritzjantzen8612
@moritzjantzen8612 2 жыл бұрын
how can i change betwen 2 object on a buttonclick
@hernandeztorresederjairdej5564
@hernandeztorresederjairdej5564 4 жыл бұрын
Can you make a video of how to interact with the objects displayed on the plane? I want to interact with them using the distance of the camera to the object and interact with them touching the screen
@DineshPunni
@DineshPunni 4 жыл бұрын
Definitely planned! Stay tuned :)
@iziaulla
@iziaulla 4 жыл бұрын
Hi Dinesh, had a few questions regarding this video that I hope you would shed some light on for me. First thing, I liked how you were able to move the instantiated cube without having to go through the TouchPhases (TouchPhase.Begin, TouchPhase.Moved, ...). So you don't really need them correct? Second question that I had was the actual instantiation of the cube. I'm not sure if you've used Google ARCore or not to do AR stuff, but in Google ArCore I was able to instantiate an object if the plane was vertical, horizontal, or both. Can you do the same with AR Foundation?
@DineshPunni
@DineshPunni 4 жыл бұрын
Heyhey sure, 1. In the video, the cube (or any instantiated object) is following the image that is beeing tracked. I was basically moving the image on my screen and the cube followed. If you want to move the objects though touch input on your device you'll need a different approach. 2. As far as I know, AR Foundation has vertical and horizontal plane detection as well. Especially with Unity's MARS tools it should be possible. A lot of time has passed since recording the video, so I'm quite sure it should be working :)
@ashwitapalekar8223
@ashwitapalekar8223 3 жыл бұрын
Hey Dinesh, Quick question, is there a way to ray cast a cube/cylinder object ontop of another cube/cylinder using raycasting?
@DineshPunni
@DineshPunni 3 жыл бұрын
You could add a collider on your first cube and if the raycast detects this specific collider you can instantiate a cube ontop of the first one.
@gaylearadanas1640
@gaylearadanas1640 3 жыл бұрын
Hi Dinesh, this was such an easy to follow tutorial! Just one question, I followed the steps but when i went to build the scene and test it out, the cube does not appear when I tap the screen. I am using an android, Samsung Note 10 if that gives any pointers.
@DineshPunni
@DineshPunni 3 жыл бұрын
Hey Gayle, thanks for the feedback. It's quite hard to do remote debugging without knowing much about the project. It could be a tiny mistake but hard to see. This gave me the idea that I'll do a video very soon on HOW exactly you can find out and debug those problems on your own! I explain it in my recent course already but a video on KZbin will be following as well. But if you're interested feel free to check it out. www.dineshpunni.com/immersive-insiders
@ecarttop6955
@ecarttop6955 2 жыл бұрын
Great tutorial . Can you share the script ¿ tks
@naitikpandya3067
@naitikpandya3067 4 жыл бұрын
how can i Add the list of object in this application???
@sukalpomitra
@sukalpomitra 4 жыл бұрын
Hi Can you show how to create a AR portal. The portal can be video/still image
@DineshPunni
@DineshPunni 4 жыл бұрын
Will do in some future videos!
@nocrune3190
@nocrune3190 2 жыл бұрын
Hi I have a problem I updated my unity and AR Foundation and XR Toolkit to 4.and when I drag the ARTap to place code , it attaches the AR Raycastmanager that needs RayCast Prefab and this is not in video and I think it is because of update.what should I do?
@DineshPunni
@DineshPunni 2 жыл бұрын
Unity releases updates every few months and sometimes they deprecate/add few methods/components. So, you will have to look at their documentation for the version that you are using and make the necessary changes.
@MartinVaupell
@MartinVaupell 4 жыл бұрын
now how to add a UI ;) perhaps some on screen text, tryied tmp with no luck it does not render
@DineshPunni
@DineshPunni 4 жыл бұрын
Thanks for the suggestion. Got this request quite some times now, so I‘ll do a video on it near future
@arjunpramod3065
@arjunpramod3065 4 жыл бұрын
can you do a tutorial on anchors?
@DineshPunni
@DineshPunni 4 жыл бұрын
Definitely a topic that I want to cover in future videos
@e3di1
@e3di1 4 жыл бұрын
Amazing tutorial, thanks so much. I have a quick question if you don't mind please. How would I stop the cube position being effected when someone clicks on a UI icon please? Thanks :-)
@DineshPunni
@DineshPunni 4 жыл бұрын
Thank you :) Best would be to invoke an event that disables the movement of the cube in the else clause (Line 54). There are (as always) a lot of ways to achive this but one simple solution is to have another if clause in there that checks if the button has been clicked. Something like: ... else { if(!buttonClicked) { spawnedObject.transform.position = hitpose.position; } }
@e3di1
@e3di1 4 жыл бұрын
@@DineshPunni Wow thanks for that!! I really appreciate it. I seem to get an error saying 'The name 'buttonClicked) does not exist in the current context' .
@DineshPunni
@DineshPunni 4 жыл бұрын
@@e3di1 Because that was only a small example, how it could be done. If you want it to work this way you'll have to define a public bool variable called buttonClicked, which get's set to true when actually clicking on the UI. I'd recommend to check out Unity's UI tutorial if you haven't worked with it before.
@DineshPunni
@DineshPunni 4 жыл бұрын
Check it out here learn.unity.com/search?k=%5B%22q%3Aui%22%5D
@e3di1
@e3di1 4 жыл бұрын
@@DineshPunni Thanks a lot, I will have a look. Much appreciated.
@MartinVaupell
@MartinVaupell 4 жыл бұрын
I also noticed something, when i add a transform rotation to the object it does not rotate when placed in AR, so i think there must be a different method to make the prefab do its thing. i am wondering if the script executes once placed.
@larryparent7128
@larryparent7128 4 жыл бұрын
If the script is attached to the prefab then it should. I would have to see the code.
@MartinVaupell
@MartinVaupell 4 жыл бұрын
@@larryparent7128 HAha,, ok imagine a simple box.. then add a script with this line in the update transform.rotate(vector3.right * 0.5f * time.deltaTime Sorry on my phone atm, not with my computer :D so typos and letters :D
@MartinVaupell
@MartinVaupell 4 жыл бұрын
lmao, the speed is the issue, 0.5f is like barely moving. increased to 40f and its all good :p
@DineshPunni
@DineshPunni 4 жыл бұрын
Glad to hear it worked now :)
@kishanpatel2592
@kishanpatel2592 4 жыл бұрын
hey buddy ! can you help me with swapping between the different models after the ground plane is detected....
@kishanpatel2592
@kishanpatel2592 4 жыл бұрын
suppose I have 4 different models which i want to place after clicking them like you did it with only one object...how to do that
@DineshPunni
@DineshPunni 4 жыл бұрын
One way would be that you save your models in a generic List (maybe List) and then iterate through that list when tapping on the floor. It's then up to you what to do, once the last item is reached.
@pauline613
@pauline613 4 жыл бұрын
hello, is there a way to spawn the object and make the object stays where it is and not move at all?
@iziaulla
@iziaulla 4 жыл бұрын
I believe that the Instantiate method has a fourth parameter where you can define the parent game object and I've always put 'transform' as the fourth argument. I think by doing so you could make the spawned game object a child of the plane.
@jayviradiya9182
@jayviradiya9182 3 жыл бұрын
Hey dear, I am a student and want to use some AR stuff in my project. I want to make it like picking a point by touching the screen and my 3d object starts from that point. Another thing want to ask that can I make my model transparent so I can see my actual world scenes behind the placed models? Actually, I want to place my model on the real object with real-world dimensions. Can it possible? Can you guide me? Thanks a lot.
@DineshPunni
@DineshPunni 3 жыл бұрын
Hey, technically that's no problem. Basically you can follow this tutorial and add an transparent shader to your object where you can set the transparency of that object. Maybe I'll do a course on that in the future. Stay tuned!
@anawp351
@anawp351 4 жыл бұрын
Plz Plz Share Scrpit
@tahmassraheem2213
@tahmassraheem2213 4 жыл бұрын
Thanks for the best tutorial but i have a question. Can i place 3d objects with tap on plane detection? Also i want to create an app which should detect target object like table chair etc and place 3d model of any kind like of dinosaurs or of some animal etc upon the target. what should i do? please help
@tahmassraheem2213
@tahmassraheem2213 4 жыл бұрын
reply please
@DineshPunni
@DineshPunni 4 жыл бұрын
Hey, so do you mean that the phone should detect, if the tracked plane might be a table, chair etc and should place an object on top of that semantic plane?? This is exactly something that I'll cover very soon on this channel!
@NarratorSama
@NarratorSama 3 жыл бұрын
I get an error that says that TrackableType does not exist in the current context. Any fixes for this?
@DineshPunni
@DineshPunni 3 жыл бұрын
Hey, make sure you have the exact same Unity AND ARFoundation version like in the video
@serwer9595
@serwer9595 4 жыл бұрын
can someone tell me , how to disable this function ?
@Neos4398
@Neos4398 2 жыл бұрын
How do I get this to work with the new Input System Unity uses?
@DineshPunni
@DineshPunni 2 жыл бұрын
We are currently updating our projects and we'll let you know soon. So, stay tuned :)
@loelmaansipothuri133
@loelmaansipothuri133 3 жыл бұрын
I am getting error in line 40 and 43 help me with that
@viniciusandrade3200
@viniciusandrade3200 4 жыл бұрын
Hi Dinesh! I've got some problems... I can instantiate the Object but i can't see the material called Visualizer (the transparent one).
@DineshPunni
@DineshPunni 4 жыл бұрын
Hey, check if you maybe forgot to reference the visualizer. It's a common Unity mistake :)
@nicolasbucco1180
@nicolasbucco1180 4 жыл бұрын
Great tutorial! I don't have Game Object To instantiate in the tabe when I click on AR Session Origin. I re-did the code 3 times, what am I missing? I would really appreciate some help! :)
@DineshPunni
@DineshPunni 4 жыл бұрын
Hey, can you doublecheck the Unity and ARFoundation (and other AR pakages) version to make sure we are in the same situation. That is the first thing many developers forget to do :)
@nicolasbucco1180
@nicolasbucco1180 4 жыл бұрын
@@DineshPunni Thank you so much for the quick reply! I have updated from 2.1.8 to version 3.1.3 (ARFoundation & ARCore) and I still don't have the Game Object To instantiate. And I also got a 2 messages: error CS0136: A local parameter named 'touchPosition' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter, and also error CS0103: The name 'hitpose' does not exist in the current context. I'm using Unity 2019.3.11 BTW. Thanks again!
@sabuthomas6320
@sabuthomas6320 3 жыл бұрын
@@nicolasbucco1180 hey were you able to fix it? i'm facing the same problem.
@nicolasbucco1180
@nicolasbucco1180 3 жыл бұрын
@@sabuthomas6320 Unfortunately no! I tried several things, it's just not working!
@rajessaravanan
@rajessaravanan 4 жыл бұрын
Hello IMERSITY I'am getting the below two errors with the Script using Unity 2019.3.0f6 building for Android Assets\Scripts\ARTapToPlaceObject.cs(20,42): error CS0246: The type or namespace name '_arRaycastManager' could not be found (are you missing a using directive or an assembly reference?) Assets\Scripts\ARTapToPlaceObject.cs(47,33): error CS1955: Non-invocable member 'ARTapToPlaceObject.gameObjectToInstantiate' cannot be used like a method. Thank you
@NarratorSama
@NarratorSama 3 жыл бұрын
Did you ever find a solution? I'm having the same problem, but with 'ARSubsystems' not existing in the namespace.
@BobRoss-uq2wu
@BobRoss-uq2wu 4 жыл бұрын
Is there a way to raycast and get the object it hit in AR then you can manipulate it?
@DineshPunni
@DineshPunni 4 жыл бұрын
You could shoot an ARRaycast and cache the first hit that you want to manipulate. Maybe highlight it, so the user knows which object you are talking about. After you are done you could close the interaction with tapping somewhere else
@BobRoss-uq2wu
@BobRoss-uq2wu 4 жыл бұрын
@@DineshPunni Sorry, I'm new to unity. Just a few things cos I don't know a lot. 1) What filter do I use on the ARRaycast and 2) how do I access the object after like cache it as you said. Thanks in advance!
@DarkHeliosGamesInteractive
@DarkHeliosGamesInteractive 4 жыл бұрын
Hello there amazing tuts I'm totally a new user with no knowledge for coding I just purchased a unity c# course and trying to get familiar. I have a question how we can put just one object? I'm a 3D artist I have modelled a Japan temple and I want to put it in my centre of my room and enjoy it like I was in VR I know we have first detect a floor plane that's ok I followed your other tuts and I have visualisers and all I just want a stable Temple in my room without losing him if I look on the roof of my room everything drifting away I have android and iPhone 10 in iOS is more stable but that have to do also with the power of the processing by the device. Forgive me for the big comment here any help or direction will be a lot appreciated. Thanks again for your tuts keep doing what you do you are awesome.
@DineshPunni
@DineshPunni 4 жыл бұрын
Hey there, for some reason KZbin decided to put this comment under spam so I didn't see it right away 🙄 If you got you right you want to spawn the temple model instead of the cube. So basically you have to create a prefab of the temple model and put it in the GameObject to instantiate field. And yes,from my experience as well, the tracking is more accurate on the iOS than on Android.
@DarkHeliosGamesInteractive
@DarkHeliosGamesInteractive 4 жыл бұрын
Yes you got it right but I wanted it to put the temple just one time
@DineshPunni
@DineshPunni 4 жыл бұрын
@@DarkHeliosGamesInteractive Okay, then simply try to uncomment/remove line 54
@DineshPunni
@DineshPunni 4 жыл бұрын
Let me know, if it worked. I'm travelling at the moment, so i can't test it right now
@user-tz7nu9hm7x
@user-tz7nu9hm7x 4 жыл бұрын
@@DineshPunni Thanks so much for your lessons !! Sorry, I am writing through Google translator. Yes, it worked! Russian hackers are very grateful to you :) A joke, otherwise the big brother will not correctly understand the joke
@SpriteTheDude
@SpriteTheDude 2 жыл бұрын
can I place objects on a plane that is already in the unity scene?
@DineshPunni
@DineshPunni 2 жыл бұрын
Yeah, it doesn't matter if the object is in the scene already or not.
@mai12313ify
@mai12313ify 3 жыл бұрын
how i can put a canvas into AR camera ?? Any Suggestion ? please
@DineshPunni
@DineshPunni 3 жыл бұрын
You can just add a canvas as usual to it
@merouabengadem1303
@merouabengadem1303 3 жыл бұрын
HI ! does it work with hololens 2 ?
@DineshPunni
@DineshPunni 3 жыл бұрын
Technically it does, AR Foundation now also supports HoloLens 2 but I haven't tested it yet
@joshuatree1577
@joshuatree1577 3 жыл бұрын
This is almost the same code from Dilmer Valecillos from a tutorial 1 year before. This script just allows one prefab in the scene.
@DineshPunni
@DineshPunni 3 жыл бұрын
Well, simple code is the same all over the world ;) It's most likely gonne be similar to Unity's and whoever elses video
@itechsoftwarehouse9018
@itechsoftwarehouse9018 3 жыл бұрын
how to place object by button
@ScreamoxXxX
@ScreamoxXxX 4 жыл бұрын
Has anyone managed to spawn a different prefab for each tap? if so, how?
@mathef
@mathef 4 жыл бұрын
I am a beginner, so there will be a better way of doing it, but you can try to have a list of prefabs and put into a variable your click count. Use the variable to spawn objects from the list by their index number.
@KM-mh8vm
@KM-mh8vm 3 жыл бұрын
I'm Working on this project with iPhone but, when I tap the screen it didn't show anything on my device. Is this only works for Android?
@KM-mh8vm
@KM-mh8vm 3 жыл бұрын
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.ARFoundation; using UnityEngine.XR.ARSubsystems; [RequireComponent(typeof(ARRaycastManager))] public class TapToPlace : MonoBehaviour { public GameObject gameObjectInstanciate; private GameObject spawnobject; private ARRaycastManager _arRaycastManager; private Vector2 touchPosition; static List hits = new List(); // Start is called before the first frame update private void Awake() { _arRaycastManager = GetComponent(); } bool TryGetTouchPosition(out Vector2 touchPosition) { if (Input.touchCount > 1) { touchPosition = Input.GetTouch(0).position; return true; } touchPosition = default; return false; } // Update is called once per frame void Update() { if (!TryGetTouchPosition(out Vector2 touchPosition)) return; if (_arRaycastManager.Raycast(touchPosition, hits, TrackableType.PlaneWithinPolygon)) { var hitPose = hits[0].pose; if (spawnobject == null) { spawnobject = Instantiate(gameObjectInstanciate, hitPose.position, hitPose.rotation); } else { spawnobject.transform.position = hitPose.position; } } } }
@sandeepkulkarni8835
@sandeepkulkarni8835 3 жыл бұрын
How to instantiate multiple objects in a plane can you tell
@DineshPunni
@DineshPunni 3 жыл бұрын
Instead of changing the position of the cube you can just instantiate a new object on every touch
@sandeepkulkarni8835
@sandeepkulkarni8835 3 жыл бұрын
Ok thank you👍😊
@marcoinfo5922
@marcoinfo5922 4 жыл бұрын
Hello, how can I contact You? The info Tab do not work, thanks
@DineshPunni
@DineshPunni 4 жыл бұрын
Hey, the best way to currently contact me besides from the comment section is via dinesh.punni@hotmail.de. But thanks for mentioning. Will update the info Tab
@marcoinfo5922
@marcoinfo5922 4 жыл бұрын
@@DineshPunni thanks, I just sent you an email
@yannis486
@yannis486 3 жыл бұрын
Why touchPosition = default?
@northisdead1999
@northisdead1999 4 жыл бұрын
My object starts shaking like crazy when I go close to it. Does anybody know why?
@DineshPunni
@DineshPunni 4 жыл бұрын
Could be due to the tracking. It's generally helpful, if you scan your environment a bit before you start doing fancy things ;) What phone did you use?
@startupryan9009
@startupryan9009 4 жыл бұрын
This is great info. Earned you a Sub! I will be back for more. My page is similar and has taken inspiration from this type of content. 😎
@sukalpomitra
@sukalpomitra 4 жыл бұрын
hi, thanks for your tutorial. I am using Unity.2019.3.0f6. I installed ARFoundation 2.1.4 and ARCore XR Plugin 2.1.2 from Package Manager. But when I go into the C# script. UnityEngine.XR shows that it only has Provider and WSA namespace. I cannot see ARFoundation. What am I doing wrong?
@sukalpomitra
@sukalpomitra 4 жыл бұрын
HI IMERSITY, found that its an issue of Omnisharp extension of Visual Studio Code. I am using Visual Studio and its working fine. Whats the Visual Studio Code version that you are using? I am in Mac 10.15.3
@DineshPunni
@DineshPunni 4 жыл бұрын
Glad you found it on your own :) I‘m using the 2019 version of Visual Studio
@DarkHeliosGamesInteractive
@DarkHeliosGamesInteractive 4 жыл бұрын
Also today I have 3 critical errors..... : (
@DineshPunni
@DineshPunni 4 жыл бұрын
Can you tell us about the errors? Also, what Unity + AR Foundation version are you using and what device? Maybe we can find out together
@DarkHeliosGamesInteractive
@DarkHeliosGamesInteractive 4 жыл бұрын
IMERSITY Unity 2019.2.17f1 I have to reproduce it again since I deleted the script but I remember that I hade an missing assemble error about pose and another one about hits I really don’t remember the third one
@DarkHeliosGamesInteractive
@DarkHeliosGamesInteractive 4 жыл бұрын
IMERSITY AR 3.1.0
@DineshPunni
@DineshPunni 4 жыл бұрын
hmm okay, missing assemble error about the pose script could mean that there was something wrong when importing the ARFoundation Subsystem packages in the main package.
@DarkHeliosGamesInteractive
@DarkHeliosGamesInteractive 4 жыл бұрын
@@DineshPunni iPhone XR and Sony Xperia XZ
@Ahmad_mahrooghi77
@Ahmad_mahrooghi77 3 жыл бұрын
Hi I have a problem I updated my unity and AR Foundation and XR Toolkit to 4.and when I drag the ARTap to place code , it attaches the AR Raycastmanager that needs RayCast Prefab and this is not in video and I think it is because of update.what should I do?
@ckckgroup
@ckckgroup 3 жыл бұрын
I’m having the same problem. Let me know if you find a solution!
@idiweh
@idiweh 3 жыл бұрын
Same problem, any solutions? Instantiating not working.
@adithyas4362
@adithyas4362 3 жыл бұрын
same issue, found any solution?
@vanshajarora8828
@vanshajarora8828 2 жыл бұрын
same issue, not instantiating the object, any solution? @dinesh punni
Unity AR Foundation Tutorial - Getting Started with Face Tracking
10:23
Unity AR Foundation Tutorial - Plane Detection
10:44
Dinesh Punni
Рет қаралды 88 М.
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 100 МЛН
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 49 МЛН
NERF WAR HEAVY: Drone Battle!
00:30
MacDannyGun
Рет қаралды 50 МЛН
Coding INDOOR NAVIGATION with A* Pathfinding
10:24
MatthewHallberg
Рет қаралды 182 М.
Get started with Geospatial Creator in Unity
15:21
Google AR & VR
Рет қаралды 29 М.
Apple ARKit 5 - augmented reality for iOS
20:28
r/AugmentedReality
Рет қаралды 34 М.
Augmented Reality (AR) tutorial for beginners using Unity 2022
32:11
Playful Technology
Рет қаралды 286 М.
Creating Immersive AR with Unity 2019!
5:01
Unity
Рет қаралды 112 М.
How to create Virtual buttons with Vuforia AR & Unity3D
9:25
CubicBrain
Рет қаралды 204 М.