Unity AR Foundation Tutorial - Tap to Place Objects in AR

  Рет қаралды 93,743

Dinesh Punni

Dinesh Punni

Күн бұрын

Пікірлер: 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
@Antonbergman666
@Antonbergman666 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 4 жыл бұрын
@@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 4 жыл бұрын
@@misterr3083 Thanks for the kind words :) That's great to hear 😎
@sharpeyyy
@sharpeyyy Жыл бұрын
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 :)
@seve8138
@seve8138 4 жыл бұрын
I was looking for official tutorials - nothing, just the initial setup. I'm so thankful you demonstrate all the basics of it.
@DineshPunni
@DineshPunni 4 жыл бұрын
Thanks man! If you have any questions feel free to let us know :)
@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.
@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
@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?
@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 😅
@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?
@cristopherwibowo6846
@cristopherwibowo6846 4 жыл бұрын
Hi , I like your tutorials. its works. i will try another tutorials. Thanks.
@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 :)
@joeblowers8539
@joeblowers8539 4 жыл бұрын
Great tutorial!
@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
@DungPham-xe3wz
@DungPham-xe3wz 3 жыл бұрын
thank for your video. how can i touch to prefab, then show information ?
@DineshPunni
@DineshPunni 3 жыл бұрын
Instead of moving the object when touching you can invoke an Unity event that (for example) opens up a UI with Information
@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.
@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
@TheSoullied
@TheSoullied 4 жыл бұрын
thank you from Russia!
@DineshPunni
@DineshPunni 4 жыл бұрын
Thank you too!
@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.
@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.
@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.
@e3di1
@e3di1 5 жыл бұрын
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 5 жыл бұрын
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 5 жыл бұрын
@@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 5 жыл бұрын
@@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 5 жыл бұрын
Check it out here learn.unity.com/search?k=%5B%22q%3Aui%22%5D
@e3di1
@e3di1 5 жыл бұрын
@@DineshPunni Thanks a lot, I will have a look. Much appreciated.
@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.
@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👏👏👏
@gaylearadanas1640
@gaylearadanas1640 4 жыл бұрын
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 4 жыл бұрын
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
@moritzjantzen8612
@moritzjantzen8612 2 жыл бұрын
how can i change betwen 2 object on a buttonclick
@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 :)
@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
@UjjwalDubey1994
@UjjwalDubey1994 3 жыл бұрын
Thank you so much!
@DineshPunni
@DineshPunni 3 жыл бұрын
Glad it helped! :)
@professorm4171
@professorm4171 5 жыл бұрын
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 5 жыл бұрын
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 5 жыл бұрын
@@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 5 жыл бұрын
@@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 5 жыл бұрын
@@DineshPunni I'm on iOS and seeing overall performance issues. I guess Unity needs to finalize ARFoundation.
@DineshPunni
@DineshPunni 5 жыл бұрын
@@professorm4171 Yeah, can't agree more on that. Fortunately they keep pushing updates very regulary. And with every update it get's more stable.
@seve8138
@seve8138 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
@@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
@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
@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?
@Wonder_Verse_Tech
@Wonder_Verse_Tech Жыл бұрын
Did you figured it out ? please explain me
@biancadragomir
@biancadragomir 3 жыл бұрын
Great tutorial, thanks a lot!
@DineshPunni
@DineshPunni 3 жыл бұрын
Happy to help :)
@MEBAkhila
@MEBAkhila 2 жыл бұрын
How to connect more scenes together in object tracking AR
@riven_drea
@riven_drea 2 жыл бұрын
The best overload for 'GetTouch' does not have a parameter named 'Index'. is there any clue for this problem ?
@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
@Wonder_Verse_Tech
@Wonder_Verse_Tech Жыл бұрын
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
@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 :)
@Ahmad_mahrooghi77
@Ahmad_mahrooghi77 4 жыл бұрын
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 4 жыл бұрын
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
@1234yokee
@1234yokee 4 жыл бұрын
Excellent tutorials sir..but how to put camera shutter button for take a photo or save a photo..any tutorials? pls sir
@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!
@jayviradiya9182
@jayviradiya9182 4 жыл бұрын
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 4 жыл бұрын
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!
@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
@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!
@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 }
@sachibro6838
@sachibro6838 4 жыл бұрын
best app evar
@ashmitag4022
@ashmitag4022 4 жыл бұрын
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.
@lighttv6255
@lighttv6255 4 жыл бұрын
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
@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
@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 4 жыл бұрын
@@nicolasbucco1180 hey were you able to fix it? i'm facing the same problem.
@nicolasbucco1180
@nicolasbucco1180 4 жыл бұрын
@@sabuthomas6320 Unfortunately no! I tried several things, it's just not working!
@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 :)
@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.
@anawp351
@anawp351 4 жыл бұрын
Plz Plz Share Scrpit
@aarons4078
@aarons4078 2 жыл бұрын
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!
@alexfaure6031
@alexfaure6031 4 жыл бұрын
Hi, how to delete precedent object for having just one by one objet ? tks !!
@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?
@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.
@bruceb85
@bruceb85 4 жыл бұрын
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?
@DarkHeliosGamesInteractive
@DarkHeliosGamesInteractive 5 жыл бұрын
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 5 жыл бұрын
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 5 жыл бұрын
Yes you got it right but I wanted it to put the temple just one time
@DineshPunni
@DineshPunni 5 жыл бұрын
@@DarkHeliosGamesInteractive Okay, then simply try to uncomment/remove line 54
@DineshPunni
@DineshPunni 5 жыл бұрын
Let me know, if it worked. I'm travelling at the moment, so i can't test it right now
@РенальБиктимиров
@РенальБиктимиров 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
@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.
@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.
@dono__ft6671
@dono__ft6671 3 жыл бұрын
How can we do for multiple objects ?
@ecarttop6955
@ecarttop6955 2 жыл бұрын
Great tutorial . Can you share the script ¿ tks
@skudgee2
@skudgee2 4 жыл бұрын
This is good stuff
@arjunpramod3065
@arjunpramod3065 4 жыл бұрын
can you do a tutorial on anchors?
@DineshPunni
@DineshPunni 4 жыл бұрын
Definitely a topic that I want to cover in future videos
@Neos4398
@Neos4398 3 жыл бұрын
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 :)
@tanmaysinghal8370
@tanmaysinghal8370 3 жыл бұрын
BRo please create a tutorial on measurement app using ar from scratch
@naitikpandya3067
@naitikpandya3067 4 жыл бұрын
how can i Add the list of object in this application???
@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 :)
@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!
@mai12313ify
@mai12313ify 4 жыл бұрын
how i can put a canvas into AR camera ?? Any Suggestion ? please
@DineshPunni
@DineshPunni 4 жыл бұрын
You can just add a canvas as usual to it
@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
@SpriteTheDude
@SpriteTheDude 3 жыл бұрын
can I place objects on a plane that is already in the unity scene?
@DineshPunni
@DineshPunni 3 жыл бұрын
Yeah, it doesn't matter if the object is in the scene already or not.
@loelmaansipothuri133
@loelmaansipothuri133 4 жыл бұрын
I am getting error in line 40 and 43 help me with that
@NarratorSama
@NarratorSama 4 жыл бұрын
I get an error that says that TrackableType does not exist in the current context. Any fixes for this?
@DineshPunni
@DineshPunni 4 жыл бұрын
Hey, make sure you have the exact same Unity AND ARFoundation version like in the video
@madpccapel
@madpccapel 4 жыл бұрын
please make a video to put masks on android, thank you very much and new subscriber
@sandeepkulkarni8835
@sandeepkulkarni8835 4 жыл бұрын
How to instantiate multiple objects in a plane can you tell
@DineshPunni
@DineshPunni 4 жыл бұрын
Instead of changing the position of the cube you can just instantiate a new object on every touch
@sandeepkulkarni8835
@sandeepkulkarni8835 4 жыл бұрын
Ok thank you👍😊
@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 4 жыл бұрын
Did you ever find a solution? I'm having the same problem, but with 'ARSubsystems' not existing in the namespace.
@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
@KM-mh8vm
@KM-mh8vm 4 жыл бұрын
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 4 жыл бұрын
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; } } } }
@germanyyoutube573
@germanyyoutube573 5 жыл бұрын
Vree niceee 😊
@DineshPunni
@DineshPunni 5 жыл бұрын
Thanks!
@serwer9595
@serwer9595 4 жыл бұрын
can someone tell me , how to disable this function ?
@itechsoftwarehouse9018
@itechsoftwarehouse9018 4 жыл бұрын
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.
@joshuatree1577
@joshuatree1577 4 жыл бұрын
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 4 жыл бұрын
Well, simple code is the same all over the world ;) It's most likely gonne be similar to Unity's and whoever elses video
@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?
@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 5 жыл бұрын
Also today I have 3 critical errors..... : (
@DineshPunni
@DineshPunni 5 жыл бұрын
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 5 жыл бұрын
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 5 жыл бұрын
IMERSITY AR 3.1.0
@DineshPunni
@DineshPunni 5 жыл бұрын
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 5 жыл бұрын
@@DineshPunni iPhone XR and Sony Xperia XZ
@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. 😎
@nocrune3190
@nocrune3190 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?
@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.
Unity AR Foundation Tutorial - Getting Started with Face Tracking
10:23
Everything You Need To Know About Getting a Job In VR (in 2024)
13:28
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 52 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 52 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
Simon Sinek's Advice Will Leave You SPEECHLESS 2.0 (MUST WATCH)
20:43
Alpha Leaders
Рет қаралды 599 М.
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
The New Outlook is TERRIBLE
20:19
Chris Titus Tech
Рет қаралды 105 М.
10 UNFORGETTABLE GOLDEN BUZZER AUDITIONS You Must Watch
59:01
Popcorn
Рет қаралды 11 МЛН
Coding INDOOR NAVIGATION with A* Pathfinding
10:24
MatthewHallberg
Рет қаралды 193 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 52 МЛН