Gestures to Place, Move, Rotate, and Scale Multiple Objects in AR Unity - XR Interaction Toolkit
Vložit
- čas přidán 31. 07. 2024
- In this AR Foundation tutorial, you will learn how to implement tap to place multiple objects with plane tracking in Augmented Reality without writing any code. You will also learn how to use gestures to move, rotate, and scale the spawned objects. This tutorial uses AR Foundation and XR Interaction Toolkit.
Gesture details:
• Single-finger drag gesture to move or rotate
• Two-finger twist gesture to rotate
• Two-finger pinch gesture to scale
🔗 Links:
XR Interaction Toolkit doc: docs.unity3d.com/Packages/com...
Basic setup video: • Basic Setup for AR Fou...
⏰ Timestamps:
0:00 Intro
0:21 Project setup
0:32 Add XR interaction toolkit
0:53 Scene setup
1:40 Add AR gesture interactor
2:30 Add plane tracking
3:20 Add AR placement interactable
4:05 Add move gesture
5:32 Add rotation gesture
6:00 Add scale gesture
6:41 Result
7:22 Outro
AR Foundation is a cross-platform framework for Augmented Reality development in Unity that supports ARCore on Android and ARKit on iOS.
XR Interaction Toolkit provides a set of scripts that make it easy to add common interactions to your AR experiences.
💡 CC is available. Please feel free to send any questions, comments, suggestions, or feedback.
🌐 Connect:
Patreon: / xiennastudio
Twitter: / xiennastudio
Discord: / discord
Donate: ko-fi.com/xiennastudio
#unity3d #augmentedreality #arfoundation #arcore #arkit #madewithunity #gamedev
Correction: In 5:16, please hide the selection game object in the prefab so it won't show up when the object is spawned. My apologies for missing this.
Please keep the tutorials coming. These are amazing!
Oh my goodness. This is amazing. This exactly what I have been looking for. Thanks Xienna. Subscribing now!.
Thank you so much for your kind words and for subscribing! 😄
This is amazing Xienna. Keep up!
Thank you so much!!
Thanks a lot! Very informative
Great tutorial !
Thank you!
Thank you 💫
No problem 😊
where can I get or how can I create that outline circle@@xiennastudio
hello, i have been using ar foundation 4, but i want to upgrade them to ver 5. but i have condition with spawning object with AssetBundle. how to use ar placement interactable with assetbundle ?
Hello is there a way to create many insertable prefabs instead of one? currently creating my own training visual app thank you! Love hearing from you soon
Are there any ways to delete selected object with a button?
hy i wanted i ask how do we created ar placment interactable in ar foundation i was not able to find any resousrce to do it could suggest some help
@xiennastudio how if I want to spawn only just one object? thank you! Urgent :(
Hii. Your video is just perfect. In your next video can you teach how to turn off the Plane Prefab when the 3d object is placed on the ground(How to Disable and Enable AR Plane Detection). Then I think our program would be more perfect. Many thanks in advance.
Or you can answer how to do it in the comment?
Hey! Thanks a ton for the tutorial. Could you please tell how can I improve the quality of the plane detection. I use a powerful android device still the plane detection is very poor, vertical planes are never detected horizontal planes are hardly being detected and they start moving as I move the camera :') Should I switch to an apple device once ? or if there's anything which would help please let me know . Thank you so much for the tutorial again :D
Hi, yes, Apple's camera is better at tracking, but have you tried it on different locations? Your environment may not be suitable for plane detection. ARCore plane detection is not really good at detecting reflective surfaces, complex backgrounds, and low light conditions. Make sure that your environment is well-lit and free of reflective surfaces.
Also, make sure in AR Plane Manager to put 'Everything' in the Detection Mode variable so you can track vertical planes.
And try to update your Unity version as some versions have bugs forum.unity.com/threads/ar-foundation-5-poor-stability-and-drift-even-in-samples.1390011/#post-9160778
hi, I'm new to unity. can you explain more on the outline? How to import outline to use with the project?
Hi, just drag and drop the outline image you want to use to Unity.
Hi. Can you please guide on how to delete the selected object?
I'm new to the XR Interaction Toolkit.
We have the same problem, have you found the solution?
could be possible test it with XR simulator? or only with a device?
Hi, you can test some of the single-touch gestures, such as spawning, selecting, and moving objects, in XR Simulation. To do this, first use the Scene view to move around the scene and track the plane. Then, switch to Game view to test the single-touch gestures. However, for multi-touch gestures like rotation and scaling, you'll need to test your app on an actual device.
wow!!! that's an amazing tutorial, but I have an issue, how if Iwant to spawn only just one object? thank you!
Thank you! The XR Interaction Toolkit's basic scripts only support spawning multiple objects. If you need to spawn only one object, you can disable the Placement script after spawning it. However, you will still need to select the object to interact with it. I'm still working on implementing spawning one object and interacting without needing to select it.
@@xiennastudio hi, love your videos. is there any update on this? I want to spawn 1 object and interact with it as well
Very Good Video 😁, Can it only display one object when clicked and not display a new object when clicking in a different area?
Thank you! The XR Interaction Toolkit's basic scripts only support spawning multiple objects. If you need to spawn only one object, you can disable the Placement script after spawning it. However, you will still need to select the object to interact with it. I'm still working on implementing spawning one object and interacting without needing to select it.
Hi @@xiennastudio. Your tutorials have been very helpful and I really appreciate the efforts you put in for quality work. I'm also waiting for your tutorial on spawning single object and scaling, rotating and translating single object.
My phone is OPPO Reno7 Z 5G but when I put apk into my phone can enter but no camera,allI can see is dark
Hi, is your device from China? Based on ARCore supported lists, OPPO Reno7 Z 5G is not supported with ARCore if it's from China developers.google.com/ar/devices#android_china
@@xiennastudio I take my mom's oppo reno10 pro but it is black again,could you sand your apk to me,let me try it, please,thank you
you can check your camera permission once. @@user-ch6xf7ef8y
Hi! I loved the tutorial but I do have a problem with the prefabs Interaction Manager and XR Origin reference. I follow your steps at 4:27, but when I create a prefab by dragging it in the project window, it loses the references. Consequently, I can't interact with the spawned items. Any idea on how to fix?
Hi! Losing the reference is fine, as Unity will automatically add the reference when we play the scene. Did you try it on your device or just in the Editor?
@@xiennastudioI tried in both editor and building the app on Android, but the result is the same. It just keep losing the reference :(
Can you send a screenshot or video when you test in the Editor? You can send it through Email xiennastudio@gmail.com or Discord discord.gg/tuGM3zBg
@@xiennastudioSure, I'll send it asap. Thanks a lot!
@@xiennastudio I sent an email with a screen capture. Thanks for your help!
B - 10 mates like here...🤓
the visualisation gameobject appears in instanciation (before i select one object to move it)! why ?
I apologize for forgetting to mention in the video that you must hide the selection game object in the prefab to prevent it from appearing when you spawn the prefab. Thank you for bringing this to my attention!
@@xiennastudio how do i hide selection game object? i'm new at unity AR
First, select the selection game object. Then in the Inspector, there is a checkmark symbol on the left side of the game object name. Click on that to remove the checkmark. Now the game object is hidden.@@_AANgurahGdDhananjaya
Hi Xienna! Could you create a tutorial on how to hide and unhide text or information in Unity using the XR Interaction toolkit? So from your previous tutorial, instead of spawning an object when you click on the screen, you unhide hidden text and then hide them back when screen is tapped again.
Hi, thanks for the suggestion! By text do you mean the text that stays on the screen, or text that is in a 3D space?
@@xiennastudio text in 3D space.
@@xiennastudio thanks for responding. I truly appreciate it.
Sorry, just want to confirm a few more things: Instead of a Cube, the text will be spawned where the user taps on the screen? Do you want to be able to rotate and resize the text too?
Hi @@xiennastudio thanks so much for responding and please no need to be sorry, your work is amazing and it's an honour to follow and learn from your content. To answer your question, the text is spawned be beside the cube and it can be scaled as well. Plus, when the user interacts with the cube like rotating, scaling, or translating; the text follows along as well.
Thanks so much!
It can't scale individual axis 😢
Well that's a good video nonethless.