AR Foundation with Unity3d - Instantiating and Dragging Multiple Augmented Reality Objects

  Рет қаралды 25,527

Dilmer Valecillos

Dilmer Valecillos

5 жыл бұрын

In this video I extend one of the existing scripts where I provided you with dragging functionality of a single AR Object, with this extension we can now instantiate multiple AR Objects in the scene, perform multiple Raycasts, and perform dragging on any of the Raycast collissions. The code also ensures that a place hasn’t been taken by another AR Object.
This video also uses some of the core AR components taught before such as:
- AR Custom Placement Controller with Dragging Functionality on multiple instantiated AR objects
- AR Session
- AR Session Origin
- AR Camera
- AR Plane Detection
- AR Raycasting
- AR Cloud Point Detection
- AR Lightweight Rendering Pipeline
** Support me by Subscribing to the channel as it will help me in bringing a lot more content **
bit.ly/2NmnFMu
** Find the source code in Patreon and support me if you can even if it is with one of the lower tiers as it helps me in bringing you more content - THANK YOU **
/ dilmerv
** EQUIPMENT USED TO RECORD THIS VIDEO **
- Rode Wireless Go - amzn.to/2J7RCw6
- Rode smartLav+ Omnidirectional Lavalier Microphone for iPhone and Smartphones - amzn.to/2LBQra6
- Rode SC7 3.5mm TRS to TRRS Patch Cable - amzn.to/2XTaYxv
- Blue Snowball iCE Condenser Microphone - amzn.to/2Ija0lo
- JOBY GorillaPod 3K Kit. Compact Tripod 3K Stand - amzn.to/2Xh4Bni
- JOBY GorillaPod 5K Kit. Professional Tripod 5K Stand - amzn.to/31Ew0yW
- Photography Photo Portrait Studio 600W Day Light Umbrella - amzn.to/2WwI0Tc
- AmazonBasics 60-Inch Lightweight Tripod with Bag - amzn.to/2Wd8utF
- Canon EOS Rebel T6 Digital SLR Camera Kit - amzn.to/2WcnRlV
Supporters in Patreon help me and show your appreciation for all the content and source code provided thanks!
github.com/dilmerv/UnityARFou...
Support me in Patreon so I can keep doing stuff like this for free!
/ dilmerv
Get realtime indie development tips from me in Twitter
/ dilmerv
Subscribe to my indie development videos & game releases newsletter
www.dilmergames.com
Blog about Indie development and startup
www.dilmergames.com/blog

Пікірлер: 63
@RepoTD
@RepoTD 4 жыл бұрын
Hey Dilmer, I'm having an issue, when I run the code with some prefabs that I made, the prefab starts to display on the screen on every update (You can imaging how many are there) and they display even if I don't touch on the screen. Can you please help me?
@aguspray
@aguspray 2 жыл бұрын
Thank you so much for your video tutorial, I have a question, why do you use both Physical.Raycast and ARManager.Raycast in this project? what if only used one of them? I think they do the same thing.
@chamodweerasinghe8619
@chamodweerasinghe8619 2 жыл бұрын
Is there anyway we can save those prefabs under geo location to implement an indoor navigation system with AR foundation which can easily customize?
@xavierstone5191
@xavierstone5191 4 жыл бұрын
I followed your instructions, but got different results, or did I do it wrong?
@NirLouk
@NirLouk Жыл бұрын
Thanks. Can you link to your ordered video list? which one is the previous one that you did with only one object?.... you referring to it - but i can not find it in your many video titles.
@Free4Game
@Free4Game 4 жыл бұрын
why is line 79 "lastSelectedObject==null" always true if we hit a plane? it somehow works and i dont know why. if you hit an object once, the lastselectedobject variable should not be null anymore and since we never set it to null manually the line 79 should always be false. but it somehow works.. really important pls help edit: i got it. its because line 57. if the ray does not hit something lastselectedobject is set to null. now line 79 is true.
@edcutting
@edcutting 5 жыл бұрын
Thanks for the video, exactly what I was looking for! Any tips on how to place different prefabs instead of placing the same prefab each time?
@dilmerv
@dilmerv 5 жыл бұрын
Give me few hours and I will post a new video where I will implement a simple inventory with AR which will allow you to select different prefabs :) thanks for watching and for your suggestion !
@edcutting
@edcutting 5 жыл бұрын
@@dilmerv WOW!! Legend!! So impressed. Thank you so much!
@jasonhayhurst8578
@jasonhayhurst8578 5 жыл бұрын
Any advice on adapting this to show images over a cube from an array?
@dilmerv
@dilmerv 5 жыл бұрын
All you would need to do is create a separate prefab where you have a cube and a carousel type implementation on a script that could change the image based on a timer on based on touches. If that’s kind of what you seek I can implement something like that for a new video.
@cappacurta
@cappacurta 4 жыл бұрын
hello and thank you for the awesome tutorials! I got a pink screen on my iphone xs. On the xcode output I got this message "Shader is not supported on this GPU" Do you have any idea how to solve this? Thank you!
@dilmerv
@dilmerv 4 жыл бұрын
Interesting what version of Unity and XCode are you using ?
@chitrang7228
@chitrang7228 Жыл бұрын
thank you
@dilmerv
@dilmerv Жыл бұрын
You are welcome !
@facundofarall7716
@facundofarall7716 4 жыл бұрын
I don't quiet get what PlacementComponent is. Is it a Script component you add to the spheres you place?
@Free4Game
@Free4Game 4 жыл бұрын
do you mean PlacementObject? its a script he already did. check his git repo. it should be there somewhere
@jeyandranathsiddha637
@jeyandranathsiddha637 4 жыл бұрын
Can Please provide the link of previous video
@dilmerv
@dilmerv 4 жыл бұрын
Did you watch this video from the playlist ?
@andyward7961
@andyward7961 4 жыл бұрын
Hi Dilmer, thanks for the tutorial. I have followed your previous tutorial about selecting an object and about instantiating multiple objects. I am experiencing an error when instantiating multiple objects. As soon as i start my application, many objects are spawned as i look around with my phone even without pressing on the screen. I have tried to change a few things and have followed and double checked what you have included in your script however there is still an error. Thanks.
@lasurbeampew
@lasurbeampew 4 жыл бұрын
Hey Andy! Hope this helps. I experienced the same problem as you. Look at the placedPrefab, make sure that the prefab contains Placement Object Script. Check Dilmer's GitHub on this. Really helped me learn. Hope this helps you!
@alexmarasco3703
@alexmarasco3703 4 жыл бұрын
@@lasurbeampew I am also experiencing this problem and I have no idea what you mean by this
@andyward7961
@andyward7961 4 жыл бұрын
Hello, thanks for the tutorial. I have followed your previous tutorial about selecting an object and about instantiating multiple objects. I am experiencing an error when instantiating multiple objects. As soon as i start my application, many objects are spawned as i look around with my phone even without pressing on the screen. I have tried to change a few things and have followed and double checked what you have included in your script however there is still an error. Thanks.
@RepoTD
@RepoTD 4 жыл бұрын
Did you check that your scene is clear on unity? If you have any objects there they will show on the App.
@ebrahimkasaeyan8408
@ebrahimkasaeyan8408 2 жыл бұрын
I have same problem if you solved it let me know please
@madrid090909
@madrid090909 4 жыл бұрын
hi, can you please tell me how to delete selected object and clear all objects using buttons.
@dilmerv
@dilmerv 4 жыл бұрын
Sure I will make a video to show you !
@madrid090909
@madrid090909 4 жыл бұрын
@@dilmerv thank you
@rafaelladeia7278
@rafaelladeia7278 2 жыл бұрын
Thank you, Dilmer! I'm having a problem. For some reason, my code is not working. That is the exactly the same of yours, but with the difference that I'm ising the camera position to place the object, as I learned in yours previous classes.
@dilmerv
@dilmerv 2 жыл бұрын
That’s interesting, normally that may mean you didn’t add the appropriate XR plugin, for instance for iOS add ARKit XR Plugin and for Android ARCore XR Plugin. Also what device are you currently using and version of Android OS ? Thanks for this info.
@rafaelladeia7278
@rafaelladeia7278 2 жыл бұрын
@@dilmerv I'm using Android 9 in Samsung Galaxy 8. I was looking that probably my mistake is on the "PlacementObject" class...I could not understand how it exactly works at this context. Again, thank you so much for all this amazing contents!
@rafaelladeia7278
@rafaelladeia7278 2 жыл бұрын
Dilmer, an updating...The code is working now! However, I got a new problem. When I move an object, after some seconds, it back to the original position. For some reason, the modifications in the object position is temporary.
@AirWriting
@AirWriting Жыл бұрын
@@rafaelladeia7278 How did you solve the 'placementObject' issue? I think I'm having the same problem as you. If you know a solution, please teach me too. thank you
@rafaelladeia7278
@rafaelladeia7278 Жыл бұрын
@@AirWriting yes, I solved the problem but I dont remember precisely which was! Tell me your question, maybe I can help you!
@gergelynemeth5168
@gergelynemeth5168 4 жыл бұрын
Hello, What is PlacementObject variable? I can't use it, my jetbrains rider say: "Cannot resolve symbol 'PlacementObject'". What can i do? I make app for android with, ARCore. Thats the problem? Thank you
@dilmerv
@dilmerv 4 жыл бұрын
Did you download my code from GitHub ?
@gergelynemeth5168
@gergelynemeth5168 4 жыл бұрын
@@dilmerv no i just make it my own
@unownptcgo2183
@unownptcgo2183 4 жыл бұрын
why i follow the second script, that you show but i cannot instantiating and dragging multiple AR objects?
@dilmerv
@dilmerv 4 жыл бұрын
You should, this is just a demo of how I implemented at that time, you can extend it if you want to do multiple objects.
@dannyloh409
@dannyloh409 4 жыл бұрын
@@dilmerv i have follow eaxctly the same for few times, i even check the code one by one, and re-implement the scenes, can you check it again?
@dannyloh409
@dannyloh409 4 жыл бұрын
@@dilmerv i had try few times for this, even i follow exactly the same code and scene from github, still does not work as the video, can you check it one more time? thanks
@libbywhitney
@libbywhitney 2 ай бұрын
Hi, where is the code for this video?
@libbywhitney
@libbywhitney 2 ай бұрын
Hi, where is the code for this video please, I can't find it. Or can you give me a screenshot of the first 15 lines of code? This video can't show it
@dilmerv
@dilmerv 2 ай бұрын
Hello there, you can find all the scripts from this video here github.com/dilmerv/UnityARFoundationEssentials/tree/master/Assets/Scripts
@libbywhitney
@libbywhitney 2 ай бұрын
@@dilmerv but I don’t know which one, and it said PlacementObject lack “using”,what should I do?
@onuryldrm6845
@onuryldrm6845 4 жыл бұрын
how do you delete the object you create
@dilmerv
@dilmerv 4 жыл бұрын
You can do something similar of how I select it for dragging, just check if they are selected and if they are call Destroy on the ray hit game object.
@onuryldrm6845
@onuryldrm6845 4 жыл бұрын
@@dilmerv thank you so much
@muhammadhamza3440
@muhammadhamza3440 4 жыл бұрын
will it work on Android?
@dilmerv
@dilmerv 4 жыл бұрын
Try it ;)
@shashankkamath2171
@shashankkamath2171 4 жыл бұрын
hey man great vids.....but one question....do i need macbook for using ios support? also one suggestion....pls mention the basic requirements before every video
@dilmerv
@dilmerv 4 жыл бұрын
That’s a good idea and thanks for your feedback. For this video you need a Mac if you want to support iOS or a windows machine / Mac for android.
@shashankkamath2171
@shashankkamath2171 4 жыл бұрын
Dilmer Valecillos ah i see...thanks a lot ...you are awesome and precise👍🏻
@dilmerv
@dilmerv 4 жыл бұрын
You are very welcome :)
@onuryldrm6845
@onuryldrm6845 4 жыл бұрын
Hi github link is broken
@dilmerv
@dilmerv 4 жыл бұрын
I fixed the link and here is the link just in case github.com/dilmerv/UnityARFoundationEssentials
@onuryldrm6845
@onuryldrm6845 4 жыл бұрын
@@dilmerv thank you so much
@dilmerv
@dilmerv 4 жыл бұрын
You are more than welcome !!!
@yensid46
@yensid46 4 жыл бұрын
okay Dilmer this is where things get messy. In the beginning of this video you say you showed how to do dragging and dropping. In the previous two videos though The first one shows placing multiple objects on the screen when touching the plane. The second video in this playlist shows you how to select object on the screen through ray tracing. Even though in the introduction to the second video you say you are going to show how to place multiple objects. This is what is confusing me. Trying to follow what you are doing and talking about in this video is very difficult. You seem to be bouncing between several different scripts and the description is very vague as to what you are doing. It is very difficult to follow what you are attempting to do.
@dilmerv
@dilmerv 4 жыл бұрын
Thank you for your time, I need to improve and your feedback is really important, I will apply your feedback in future videos.
@andreidanciu4313
@andreidanciu4313 5 жыл бұрын
Porfavor haz videos en español! te recomiendo a todos mis amigos
@dilmerv
@dilmerv 5 жыл бұрын
Que tal Andrei si tengo pensado seguir con videos en español, dame algunas semanas y empezaré con ellos gracias !
@andreidanciu4313
@andreidanciu4313 5 жыл бұрын
@@dilmerv Muchísimas gracias, recomendado a todos mis compañeros desarrolladores y fantásticos tuyo, sigue así!
Now THIS is entertainment! 🤣
00:59
America's Got Talent
Рет қаралды 37 МЛН
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 7 МЛН
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 52 МЛН
AR Foundation & Unity 03: Image Tracking
12:12
Dinesh Punni
Рет қаралды 126 М.
Augmented Reality Tutorial | Gaze Interaction in Unity
17:18
Third Aurora
Рет қаралды 62 М.
Unity AR Foundation Tutorial - Tap to Place Objects in AR
13:43
Dinesh Punni
Рет қаралды 92 М.
Unity AR Foundation Tutorial - Plane Detection
10:44
Dinesh Punni
Рет қаралды 88 М.
Now THIS is entertainment! 🤣
00:59
America's Got Talent
Рет қаралды 37 МЛН