Augmented Reality (AR) tutorial for beginners using Unity 2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024

ความคิดเห็น • 580

  • @loadcartoons
    @loadcartoons ปีที่แล้ว +46

    Heres the code, exactly as it is in the video.
    using System;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR.ARFoundation;
    using UnityEngine.XR.ARSubsystems;
    [RequireComponent(typeof(ARTrackedImageManager))]
    public class PlaceTrackedImages : MonoBehaviour {
    // Reference to AR tracked image manager component
    private ARTrackedImageManager _trackedImagesManager;
    // List of prefabs to instantiate - these should be named the same
    // as their corresponding 2D images in the reference image library
    public GameObject[] ArPrefabs;
    //Keep dictionary array of created prefabs
    private readonly Dictionary _instantiatedPrefabs = new Dictionary();

    void Awake() {
    // Cache a reference to the Tracked Image Manager component
    _trackedImagesManager = GetComponent();
    }
    void OnEnable() {
    // Attach event handler when tracked images change
    _trackedImagesManager.trackedImagesChanged += OnTrackedImagesChanged;
    }
    void OnDisable() {
    // Remove event handler
    _trackedImagesManager.trackedImagesChanged -= OnTrackedImagesChanged;
    }

    // Event Handler
    private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs) {
    // Loop through all new tracked images that have been detected
    foreach (var trackedImage in eventArgs.updated) {
    // Get the ame of the referance image
    var imageName = trackedImage.referenceImage.name;
    // Now loop over the array of prefabs
    foreach (var curPrefab in ArPrefabs) {
    // Check wether this prefab matches the tracked image name, and that
    // the prefab hasn't already been created
    if (string.Compare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0
    && !_instantiatedPrefabs.ContainsKey(imageName)) {
    // Instantiate the prefab, parenting it to the ARTrackedImage
    var newPrefab = Instantiate(curPrefab, trackedImage.transform);
    // Add the created prefab to our array
    _instantiatedPrefabs[imageName] = newPrefab;
    }
    }
    }
    // For all prefabs that have been created so far, set them active or no depending
    // on whether their corresponding image is currectly being tracked
    foreach (var trackedImage in eventArgs.updated) {
    _instantiatedPrefabs[trackedImage.referenceImage.name]
    .SetActive(trackedImage.trackingState == TrackingState.Tracking);
    }
    // If the AR subsystem has given up looking for a tracked image
    foreach (var trackedImage in eventArgs.removed) {
    // Destroy its prefab
    Destroy(_instantiatedPrefabs[trackedImage.referenceImage.name]);
    // Also remove the instance from our array
    _instantiatedPrefabs.Remove(trackedImage.referenceImage.name);
    // Or, simply set the prefab instance to inactive
    //_instantiatedPrefabs[trackedImage.referenceImage.name].SetActive(false);
    }
    }
    }

  • @aron_hoffman1521
    @aron_hoffman1521 2 ปีที่แล้ว +261

    using System;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR.ARFoundation;
    using UnityEngine.XR.ARSubsystems;
    [RequireComponent(typeof(ARTrackedImageManager))]
    public class PlaceTrackedImages : MonoBehaviour
    {
    // Reference to AR tracked image manager component
    private ARTrackedImageManager _trackedImagesManager;
    // List of prefabs to instantiate - these should be named the same
    // as their corresponding 2D images in the reference image library
    public GameObject[] ArPrefabs;
    private readonly Dictionary _instantiatedPrefabs = new Dictionary();
    // foreach(var trackedImage in eventArgs.added){
    // Get the name of the reference image
    // var imageName = trackedImage.referenceImage.name;
    // foreach (var curPrefab in ArPrefabs) {
    // Check whether this prefab matches the tracked image name, and that
    // the prefab hasn't already been created
    // if (string.Compare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0
    // && !_instantiatedPrefabs.ContainsKey(imageName)){
    // Instantiate the prefab, parenting it to the ARTrackedImage
    // var newPrefab = Instantiate(curPrefab, trackedImage.transform);
    void Awake()
    {
    _trackedImagesManager = GetComponent();
    }
    private void OnEnable()
    {
    _trackedImagesManager.trackedImagesChanged += OnTrackedImagesChanged;
    }
    private void OnDisable()
    {
    _trackedImagesManager.trackedImagesChanged -= OnTrackedImagesChanged;
    }
    private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs)
    {
    foreach (var trackedImage in eventArgs.updated)
    {
    // var imageName = trackedImage.referenceImage.name;
    //foreach (var curPrefab in AreaEffector2DPrefabs)
    // {
    // if (string.Compare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0
    // && !_instantiatedPrefabs.ContainsKey(imageName))
    // {
    // var newPrefab = Instantiate(curPrefab, trackedImage.transform);
    // _instantiatedPrefabs[imageName] = newPrefab;
    // }
    // }
    // }
    _instantiatedPrefabs[trackedImage.referenceImage.name].SetActive(trackedImage.trackingState == TrackingState.Tracking);
    }
    foreach (var trackedImage in eventArgs.removed) {
    // Destroy its prefab
    Destroy(_instantiatedPrefabs[trackedImage.referenceImage.name]);
    // Also remove the instance from our array
    _instantiatedPrefabs.Remove(trackedImage.referenceImage.name);
    // Or, simply set the prefab instance to inactive
    //_instantiatedPrefabs[trackedImage.referenceImage.name].SetActive(false);
    }
    }
    }

    • @bceg3961
      @bceg3961 2 ปีที่แล้ว +5

      Ty!

    • @madcowboy5700
      @madcowboy5700 ปีที่แล้ว +5

      legend

    • @phananhvu1930
      @phananhvu1930 ปีที่แล้ว +3

      legend

    • @leifdavisson6409
      @leifdavisson6409 ปีที่แล้ว +4

      Unity.Tutorials.Core.Editor.BuildStartedCriterion must be instantiated using the ScriptableObject.CreateInstance method instead of new BuildStartedCriterion.
      UnityEngine.ScriptableObject:.ctor ()
      Unity.Tutorials.Core.Editor.Criterion:.ctor ()
      Unity.Tutorials.Core.Editor.PreprocessBuildCriterion:.ctor ()
      Unity.Tutorials.Core.Editor.BuildStartedCriterion:.ctor ()
      UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
      Unity.Tutorials.Core.Editor.BuildStartedCriterion must be instantiated using the ScriptableObject.CreateInstance method instead of new BuildStartedCriterion.
      UnityEngine.ScriptableObject:.ctor ()
      Unity.Tutorials.Core.Editor.Criterion:.ctor ()
      Unity.Tutorials.Core.Editor.PreprocessBuildCriterion:.ctor ()
      Unity.Tutorials.Core.Editor.BuildStartedCriterion:.ctor ()
      UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
      [ServicesCore]: To use Unity's dashboard services, you need to link your Unity project to a project ID. To do this, go to Project Settings to select your organization, select your project and then link a project ID. You also need to make sure your organization has access to the required products. Visit dashboard.unity3d.com to sign up.
      UnityEngine.Logger:LogWarning (string,object)
      Unity.Services.Core.Internal.CoreLogger:LogWarning (object) (at Library/PackageCache/com.unity.services.core@1.5.2/Runtime/Core.Internal/Logging/CoreLogger.cs:15)
      Unity.Services.Core.Editor.ProjectUnlinkBuildWarning:OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport) (at Library/PackageCache/com.unity.services.core@1.5.2/Editor/Core/Build/ProjectUnlinkBuildWarning.cs:29)
      UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
      MissingTextureException: Exception of type 'UnityEditor.XR.ARCore.ArCoreImg+MissingTextureException' was thrown.
      UnityEditor.XR.ARCore.ArCoreImg.CopyTo (UnityEngine.XR.ARSubsystems.XRReferenceImage referenceImage, System.String destinationDirectory) (at Library/PackageCache/com.unity.xr.arcore@4.2.7/Editor/ArCoreImg.cs:147)
      UnityEditor.XR.ARCore.ArCoreImg+d.MoveNext () (at Library/PackageCache/com.unity.xr.arcore@4.2.7/Editor/ArCoreImg.cs:156)
      System.String.Join (System.String separator, System.Collections.Generic.IEnumerable`1[T] values) (at :0)
      UnityEditor.XR.ARCore.ArCoreImg.ToImgDBEntry (UnityEngine.XR.ARSubsystems.XRReferenceImage referenceImage, System.String destinationDirectory) (at Library/PackageCache/com.unity.xr.arcore@4.2.7/Editor/ArCoreImg.cs:163)
      UnityEditor.XR.ARCore.ArCoreImg.ToInputImageListPath (UnityEngine.XR.ARSubsystems.XRReferenceImageLibrary library, System.String destinationDirectory) (at Library/PackageCache/com.unity.xr.arcore@4.2.7/Editor/ArCoreImg.cs:171)
      UnityEditor.XR.ARCore.ArCoreImg.BuildDb (UnityEngine.XR.ARSubsystems.XRReferenceImageLibrary library) (at Library/PackageCache/com.unity.xr.arcore@4.2.7/Editor/ArCoreImg.cs:97)
      UnityEditor.XR.ARCore.ARCoreImageLibraryBuildProcessor.BuildAssets () (at Library/PackageCache/com.unity.xr.arcore@4.2.7/Editor/ARCoreImageLibraryBuildProcessor.cs:37)
      Rethrow as Exception:
      -
      -
      -
      Error building XRReferenceImageLibrary Assets/ReferenceImageLibrary.asset: XRReferenceImage named '' is missing a texture.
      -
      -
      -
      UnityEditor.XR.ARCore.ARCoreImageLibraryBuildProcessor.Rethrow (UnityEngine.XR.ARSubsystems.XRReferenceImageLibrary library, System.String message, System.Exception innerException) (at Library/PackageCache/com.unity.xr.arcore@4.2.7/Editor/ARCoreImageLibraryBuildProcessor.cs:16)
      UnityEditor.XR.ARCore.ARCoreImageLibraryBuildProcessor.BuildAssets () (at Library/PackageCache/com.unity.xr.arcore@4.2.7/Editor/ARCoreImageLibraryBuildProcessor.cs:41)
      UnityEditor.XR.ARCore.ARCoreImageLibraryBuildProcessor.UnityEditor.Build.IPreprocessBuildWithReport.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.xr.arcore@4.2.7/Editor/ARCoreImageLibraryBuildProcessor.cs:74)
      UnityEditor.Build.BuildPipelineInterfaces+c__DisplayClass16_0.b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at :0)
      UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at :0)
      UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
      Error building Player: MissingTextureException: Exception of type 'UnityEditor.XR.ARCore.ArCoreImg+MissingTextureException' was thrown.
      Build completed with a result of 'Failed' in 0 seconds (429 ms)
      UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
      UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
      at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in :0
      at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0
      UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

    • @abhijiths7907
      @abhijiths7907 ปีที่แล้ว

      Thankyou my man

  • @monster_in_the_dark
    @monster_in_the_dark ปีที่แล้ว +4

    using System;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR.ARFoundation;
    using UnityEngine.XR.ARSubsystems;
    [RequireComponent(typeof(ARTrackedImageManager))]
    public class PlaceTrackedImages : MonoBehaviour {
    // Reference to AR tracked image manager component
    private ARTrackedImageManager _trackedImagesManager;
    // List of prefabs to instantiate - these should be named the same
    // as their corresponding 2D images in the reference image library
    public GameObject[] ArPrefabs;
    // Keep dictionary array of created prefabs
    private readonly Dictionary _instantiatedPrefabs = new Dictionary();
    void Awake() {
    // Cache a reference to the tracked image manager component
    _trackedImagesManager = GetComponent();
    }
    void OnEnable() {
    // Attach event handler when tracked images change
    _trackedImagesManager.trackedImagesChanged += OnTrackedImagesChanged;
    }
    void OnDisable() {
    //Remove event handler
    _trackedImagesManager.trackedImagesChanged -= OnTrackedImagesChanged;
    }
    // Event handler
    private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs) {
    // Loop through all new tracked images that have been detected
    foreach (var trackedImage in eventArgs.added) {
    // Get the name of the refrence image
    var imageName = trackedImage.referenceImage.name;
    // Now loop over the array of prefabs
    foreach (var curPrefab in ArPrefabs) {
    // Check whether this prefabs matches the tracked image name, and that
    // The prefabs hasn't already been created
    if (string.conpare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0
    && !_instantiatedPrefabs.ContainsKey(imageName)) {
    // Instantiate the prefab, parenting it to the ARTrackedImage
    var newPrefab = instantiate(curPrefab, trackedImage.transform);
    // Add the created prefab to our array
    _instantiatedPrefabs[imageName] = newPrefab;
    }
    }
    }
    // For all prefabs that have been created so far, set them or not depending
    // on whether their corresponding image is currently being tracked
    foreach (var trackedimage in eventArgs.updated) {
    _instantiatedPrefabs[trackedImage.referenceImage.name]
    .SetActive(trackedimage.trackingState == TrackingState.Tracking);
    }
    // If the AR subsystem has given up looking for a tracked image
    foreach (var trackedImage in eventArgs.removed) {
    // Destroy its prefab
    Destroy(_instantiatedPrefabs[trackedImage.referenceImage.name]);
    // Also remove the instance from our array
    _instantiatedPrefabs.Remove(trackedImage.referenceImage.name);
    // Or, simply set the prefab instance to inactive
    //_instantiatedPrefabs[trackedImage.referenceImage.name].SetActive(false);
    }
    }
    }

  • @luketechco
    @luketechco 2 ปีที่แล้ว +153

    Can you continue with this series? This is the very first Unity ARFoundation tutorial I have followed that isn't insanely awful. This was great, it worked, its up to date, its logical, and it goes from beginning to end without skipping steps. Signed up for your Patreon.

    • @scar3-ie237
      @scar3-ie237 2 ปีที่แล้ว +1

      I wish he would continue too !

    • @feitingschatten1
      @feitingschatten1 ปีที่แล้ว +4

      Most of what you'd do isn't specific to AR. Physics triggers, scenes, raycasts, all basic Unity stuff.

    • @Tropicaya
      @Tropicaya ปีที่แล้ว

      @@feitingschatten1 exactamundo

    • @timeforrice
      @timeforrice 8 หลายเดือนก่อน

      Would love to see more of this as well.

  • @sairapabraham4251
    @sairapabraham4251 2 ปีที่แล้ว +13

    where can I get the C#script for place tracked image ?

    • @fin4314
      @fin4314 2 ปีที่แล้ว +1

      Go to the Patreon of the channel - you can find the code there even if you're not a supporter

  • @Clicks_And_Flicks
    @Clicks_And_Flicks 7 หลายเดือนก่อน +5

    using System;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR.ARFoundation;
    using UnityEngine.XR.ARSubsystems;
    [RequireComponent(typeof(ARTrackedImageManager))]
    public class PlacedTrackedImages : MonoBehaviour
    {
    private ARTrackedImageManager _trackedImagesManager;
    public GameObject[] ArPrefabs;
    private readonly Dictionary _instantiatedprefabs = new Dictionary();
    private void Awake()
    {
    _trackedImagesManager = GetComponent();
    }
    private void OnEnable()
    {
    _trackedImagesManager.trackedImagesChanged += OnTrackedImagesChanged;
    }
    private void OnDisable()
    {
    _trackedImagesManager.trackedImagesChanged -= OnTrackedImagesChanged;
    }
    private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs)
    {
    foreach (var trackedImage in eventArgs.added)
    {
    var imageName = trackedImage.referenceImage.name;
    foreach (var curPrefab in ArPrefabs)
    {
    if (string.Compare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0 && !_instantiatedprefabs.ContainsKey(imageName))
    {
    var newPrefab = Instantiate(curPrefab, trackedImage.transform);
    _instantiatedprefabs[imageName] = newPrefab;
    }
    }
    }
    foreach (var trackedImage in eventArgs.updated)
    {
    _instantiatedprefabs[trackedImage.referenceImage.name]
    .SetActive(trackedImage.trackingState == TrackingState.Tracking);
    }
    foreach (var trackedImage in eventArgs.removed)
    {
    Destroy(_instantiatedprefabs[trackedImage.referenceImage.name]);
    _instantiatedprefabs.Remove(trackedImage.referenceImage.name);
    }
    }
    }

  • @alguembonitinho
    @alguembonitinho ปีที่แล้ว +52

    Scripity of the video above is here
    :]
    using System;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR.ARFoundation;
    using UnityEngine.XR.ARSubsystems;
    [RequireComponent(typeof(ARTrackedImageManager))]
    public class PlaceTrackedImages : MonoBehaviour
    {
    // Reference to AR tracked image manager component
    private ARTrackedImageManager _trackedImagesManager;
    // List of prefabs to instantiate - these should be named the same
    // as their corresponding 2D images in the reference image library
    public GameObject[] ArPrefabs;
    private readonly Dictionary _instantiatedPrefabs = new Dictionary();
    // foreach(var trackedImage in eventArgs.added){
    // Get the name of the reference image
    // var imageName = trackedImage.referenceImage.name;
    // foreach (var curPrefab in ArPrefabs) {
    // Check whether this prefab matches the tracked image name, and that
    // the prefab hasn't already been created
    // if (string.Compare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0
    // && !_instantiatedPrefabs.ContainsKey(imageName)){
    // Instantiate the prefab, parenting it to the ARTrackedImage
    // var newPrefab = Instantiate(curPrefab, trackedImage.transform);
    void Awake()
    {
    _trackedImagesManager = GetComponent();
    }
    private void OnEnable()
    {
    _trackedImagesManager.trackedImagesChanged += OnTrackedImagesChanged;
    }
    private void OnDisable()
    {
    _trackedImagesManager.trackedImagesChanged -= OnTrackedImagesChanged;
    }
    private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs)
    {
    foreach (var trackedImage in eventArgs.updated)
    {
    // var imageName = trackedImage.referenceImage.name;
    //foreach (var curPrefab in AreaEffector2DPrefabs)
    // {
    // if (string.Compare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0
    // && !_instantiatedPrefabs.ContainsKey(imageName))
    // {
    // var newPrefab = Instantiate(curPrefab, trackedImage.transform);
    // _instantiatedPrefabs[imageName] = newPrefab;
    // }
    // }
    // }
    _instantiatedPrefabs[trackedImage.referenceImage.name].SetActive(trackedImage.trackingState == TrackingState.Tracking);
    }
    foreach (var trackedImage in eventArgs.removed) {
    // Destroy its prefab
    Destroy(_instantiatedPrefabs[trackedImage.referenceImage.name]);
    // Also remove the instance from our array
    _instantiatedPrefabs.Remove(trackedImage.referenceImage.name);
    // Or, simply set the prefab instance to inactive
    //_instantiatedPrefabs[trackedImage.referenceImage.name].SetActive(false);
    }
    }
    }

    • @DindaArt
      @DindaArt ปีที่แล้ว +1

      Thanks! I couldn’t find it anywhere! I was feeling scammed haha

    • @eproyectos7730
      @eproyectos7730 ปีที่แล้ว

      Thanks!

    • @NotFlan
      @NotFlan ปีที่แล้ว +3

      Just curious, why is everything after
      private readonly Dictionary _instantiatedPrefabs = new Dictionary();
      and
      OnTrackedImagesChanged
      commented out, whereas its not in the video?

    • @anastasiaporunova7440
      @anastasiaporunova7440 ปีที่แล้ว

      @@DindaArt is this script working?

    • @esmeemarch612
      @esmeemarch612 ปีที่แล้ว

      I love you. Thanks!

  • @benbehar7397
    @benbehar7397 ปีที่แล้ว +6

    the right scrip ( from his developer channel)
    using System;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR.ARFoundation;
    using UnityEngine.XR.ARSubsystems;
    [RequireComponent(typeof(ARTrackedImageManager))]
    public class PlaceTrackedImages : MonoBehaviour {
    // Reference to AR tracked image manager component
    private ARTrackedImageManager _trackedImagesManager;
    // List of prefabs to instantiate - these should be named the same
    // as their corresponding 2D images in the reference image library
    public GameObject[] ArPrefabs;
    // Keep dictionary array of created prefabs
    private readonly Dictionary _instantiatedPrefabs = new Dictionary();
    void Awake() {
    // Cache a reference to the Tracked Image Manager component
    _trackedImagesManager = GetComponent();
    }
    void OnEnable() {
    // Attach event handler when tracked images change
    _trackedImagesManager.trackedImagesChanged += OnTrackedImagesChanged;
    }
    void OnDisable() {
    // Remove event handler
    _trackedImagesManager.trackedImagesChanged -= OnTrackedImagesChanged;
    }
    // Event Handler
    private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs) {
    // Loop through all new tracked images that have been detected
    foreach (var trackedImage in eventArgs.added) {
    // Get the name of the reference image
    var imageName = trackedImage.referenceImage.name;
    // Now loop over the array of prefabs
    foreach (var curPrefab in ArPrefabs) {
    // Check whether this prefab matches the tracked image name, and that
    // the prefab hasn't already been created
    if (string.Compare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0
    && !_instantiatedPrefabs.ContainsKey(imageName)) {
    // Instantiate the prefab, parenting it to the ARTrackedImage
    var newPrefab = Instantiate(curPrefab, trackedImage.transform);
    // Add the created prefab to our array
    _instantiatedPrefabs[imageName] = newPrefab;
    }
    }
    }
    // For all prefabs that have been created so far, set them active or not depending
    // on whether their corresponding image is currently being tracked
    foreach (var trackedImage in eventArgs.updated) {
    _instantiatedPrefabs[trackedImage.referenceImage.name]
    .SetActive(trackedImage.trackingState == TrackingState.Tracking);
    }
    // If the AR subsystem has given up looking for a tracked image
    foreach (var trackedImage in eventArgs.removed) {
    // Destroy its prefab
    Destroy(_instantiatedPrefabs[trackedImage.referenceImage.name]);
    // Also remove the instance from our array
    _instantiatedPrefabs.Remove(trackedImage.referenceImage.name);
    // Or, simply set the prefab instance to inactive
    //_instantiatedPrefabs[trackedImage.referenceImage.name].SetActive(false);
    }
    }
    }

  • @AbhirajGulati
    @AbhirajGulati ปีที่แล้ว +6

    Hi, I've built the app on my phone but no matter what i do it doesnt seem to be placing any objects at all. As far as i can tell i've done everything as per the video but when i open the app the camera opens but it either doesnt detect or doesnt place objects(Which one i cant tell) Are there any steps i can take to debug this?

    • @ericowususarpong3063
      @ericowususarpong3063 ปีที่แล้ว

      I am having the same issue, any resolution??

    • @elverrepolska
      @elverrepolska ปีที่แล้ว

      I've got the same issue. I do everything step by step, but camera not detect my reference image :( Samsung S21

    • @shanonfrancis5071
      @shanonfrancis5071 2 หลายเดือนก่อน

      Sorry for necroposting. Did you get it to work? At first I thought it wasn't working but then I noticed the tip of a gray cube in the corner of the screen. Then after some moving around the image I managed to get the cube to come to the screen but it's still kinda floaty and not centered.

  • @henrikjorgensen6850
    @henrikjorgensen6850 ปีที่แล้ว +7

    Hello Playful Technology
    Great dowen to earth video, perfekt tempo.
    I made the app and it runs perfectly, the camera it's starting normally on the app at my mobile device (Samsung s21), but when I point it to the anchor image, nothing happends, the 3D object does not appear above it. Can you help me/us

    • @thiago_vball
      @thiago_vball ปีที่แล้ว

      same

    • @ED-nj9uo
      @ED-nj9uo ปีที่แล้ว

      ave you found a solution by any chance?
      The same thing happens to me

  • @leifdavisson6409
    @leifdavisson6409 ปีที่แล้ว +3

    using System;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR.ARFoundation;
    using UnityEngine.XR.ARSubsystems;
    [RequireComponent(typeof(ARTrackedImageManager))]
    public class PlaceTrackedImages : MonoBehaviour {
    // Reference to AR tracked image manager component
    private ARTrackedImageManager _trackedImagesManager;
    // List of prefabs to instantiate - these should be named the same
    // as their corresponding 2D images in the reference image library
    public GameObject[] ArPrefabs;
    // Keep dicationary array of created prefabs
    private readonly Dictionary _instantiatedPrefabs = new Dictionary();
    void Awake()
    {
    _trackedImagesManager = GetComponent();
    }
    private void OnEnable()
    {
    _trackedImagesManager.trackedImagesChanged += OnTrackedImagesChanged;
    }
    private void OnDisable()
    {
    _trackedImagesManager.trackedImagesChanged -= OnTrackedImagesChanged;
    }
    private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs) {
    // Loop through all the new tracked images that have been detected
    foreach (var trackedImage in eventArgs.added) {
    // Get the name of the reference image
    var imageName = trackedImage.referenceImage.name;
    // Now loop over the array of prefabs
    foreach (var curPrefab in ArPrefabs) {
    // Check whether this prefab matches the tracked image name, and that
    // the prefab hasn't already been created
    if (string.Compare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0
    && !_instantiatedPrefabs.ContainsKey(imageName)) {
    // Instantiate the prefab, parenting it to the ARTrackedImage
    var newPrefab = Instantiate(curPrefab, trackedImage.transform);
    // Add the created prefab to our array
    _instantiatedPrefabs[imageName] = newPrefab;
    }
    }
    }
    // For all prefabs that have been created so far, set them active or not depending
    // on whether their corresponding image is currently being tracked
    foreach (var trackedImage in eventArgs.updated)
    {
    _instantiatedPrefabs[trackedImage.referenceImage.name]
    .SetActive(trackedImage.trackingState == TrackingState.Tracking);
    }
    // If the AR Subsystem has given up looking for a tracked image
    foreach (var trackedImage in eventArgs.removed)
    {
    // Destroy its prefab
    Destroy(_instantiatedPrefabs[trackedImage.referenceImage.name]);
    // Also remove the instance from our array
    _instantiatedPrefabs.Remove(trackedImage.referenceImage.name);
    // Or, simply set the prefab instance to inactive
    _instantiatedPrefabs[trackedImage.referenceImage.name].SetActive(false);
    }
    }
    }

    • @ArtyLX
      @ArtyLX ปีที่แล้ว

      hero

  • @sivamurugan9132
    @sivamurugan9132 2 ปีที่แล้ว +3

    Hi can any one assist me. When I done with coding I am receiving error in Script component in Unity as " Associate Script cannot be loaded. Please fix any compile errors and assign a value to script". But there is not error showing in Visual studio

    • @jjaylee6095
      @jjaylee6095 ปีที่แล้ว

      I have the same problem, did you solve it

  • @tadeoac4416
    @tadeoac4416 4 หลายเดือนก่อน +1

    I got a popup with this message, "Tap to place Touch surfaces to place objects"
    Someone knows how to remove it?

  • @optimus6858
    @optimus6858 ปีที่แล้ว +2

    thanks
    but my apk installs normally on android pie
    when i open it , it closes instantly

  • @bambinoesu
    @bambinoesu 2 ปีที่แล้ว +2

    sorry when i copy and paste the cs script. it keeps saying "associated script can not be loaded, please fix any compile errors and assign a valid script".
    help please.
    update:
    fixed issue. the script name has to be spelt the exact same on the cs code

    • @danielegiomigraphicdesigner
      @danielegiomigraphicdesigner ปีที่แล้ว +1

      thank you so much man! I was freaking out 😵

    • @bambinoesu
      @bambinoesu ปีที่แล้ว

      @@danielegiomigraphicdesigner you're welcome, so was I 😅

  • @elisabologni7481
    @elisabologni7481 ปีที่แล้ว +2

    Thank you very much for this tutorial. Unfortunately I got the following error when I build the project on Android: "The application requires last version of Google Play for AR". Everything seems ok. I also tried several devices without success. Any suggestions? Thanks

  • @Jordansj-lf8dc
    @Jordansj-lf8dc ปีที่แล้ว +4

    where can i get the code??? Thanks for the the great tutorial for my first experience approaching in AR.

    • @henrikjorgensen6850
      @henrikjorgensen6850 ปีที่แล้ว

      gist.github.com/alastaira/92d790ed09330ea7a45e7c3a2a4d26e1#file-placetrackedimages-cs

  • @user-el5jg3wo9b
    @user-el5jg3wo9b ปีที่แล้ว +2

    Everything built successfully but when I open the AR app it’s having a hard time recognizing the image marker, the cube object just randomly appears and disappears does anyone know how to fix this?

  • @pix3ls53
    @pix3ls53 2 ปีที่แล้ว +3

    Does anyone else have a problem where when deploying the program in a device, the object keeps flickering in and out when scanning?

    • @user-el5jg3wo9b
      @user-el5jg3wo9b ปีที่แล้ว

      I have the same issue!! Have you find the solution to that?

    • @abcdefg-hq6my
      @abcdefg-hq6my ปีที่แล้ว

      @@user-el5jg3wo9b I saw someone else with same issue in comments and again I know it's a bit late but I've had this issue and managed to resolve it by simply changing 0 to 1 in the AR Tracked Image Manager component that is attached to the AR Session Origin.

  • @jodexcreates
    @jodexcreates 2 ปีที่แล้ว +9

    For those having an issue with the script compiling, try making sure the class name in the CS file is the same exact name as the CS file, casing and all.

    • @bruhbeat3047
      @bruhbeat3047 2 ปีที่แล้ว

      .cs on the name to??, it didn't let me add it, got an error saying,"The associated script can not be loaded. Please fix any compile error and assign a valid script"

    • @jodexcreates
      @jodexcreates 2 ปีที่แล้ว

      @@bruhbeat3047 no, don't include the ".cs" part in the script class name. Just put the name that's in front. If you still have an error, then it's probably a different syntax error so go through the code again and see if you have anything missing or in a wrong format.

    • @user-rj1hx3gw2b
      @user-rj1hx3gw2b ปีที่แล้ว

      how I can get the script file please

    • @bruhbeat3047
      @bruhbeat3047 ปีที่แล้ว +2

      @@user-rj1hx3gw2b if you open the description of the video you'll see the link to his paterion, hit that and scroll down to the thumb nail of this video it's linked there,
      Btw I've just been helping people in the comments just look around and you should be able to find other people's that I helped with 👍

    • @lste1868
      @lste1868 ปีที่แล้ว +2

      king

  • @manofculture8666
    @manofculture8666 2 ปีที่แล้ว +8

    It baffles me as to how this channel is the only one with good and easy to understand Unity Augmented Reality tutorials.
    I remember watching your Vuforia tutorial about 3-4 years ago. Great stuff!

  • @GBart
    @GBart ปีที่แล้ว +1

    Slightly cleaner version of the script:
    public class TrackedImageManagerAddon : MonoBehaviour {
    private ARTrackedImageManager _tim;
    private Dictionary _trackers = new Dictionary();
    public TrackerModel[] TrackerModels;
    private void Awake()
    {
    _tim = GetComponent();
    }
    private void OnEnable()
    {
    _tim.trackedImagesChanged += OnTrackedImagesChanged;
    }
    private void OnDisable()
    {
    _tim.trackedImagesChanged -= OnTrackedImagesChanged;
    }
    private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs args)
    {
    AddTrackers(args.added);
    UpdateTrackers(args.updated);
    RemoveTrackers(args.removed);
    }
    private void AddTrackers(List images)
    {
    foreach (ARTrackedImage trackedImage in images)
    {
    string imageName = trackedImage.referenceImage.name;
    TrackerModel model = TrackerModels.FirstOrDefault(p => p.ImageName == imageName);
    // TODO: Handle null???
    if (model == null) continue;
    _trackers[imageName] = Instantiate(model, trackedImage.transform);
    }
    }
    private void UpdateTrackers(List images)
    {
    foreach (ARTrackedImage trackedImage in images)
    {
    string imageName = trackedImage.referenceImage.name;
    if (!_trackers.ContainsKey(imageName)) continue;
    _trackers[imageName].gameObject
    .SetActive(trackedImage.trackingState ==
    UnityEngine.XR.ARSubsystems.TrackingState.Tracking);
    }
    }
    private void RemoveTrackers(List images)
    {
    foreach (ARTrackedImage trackedImage in images)
    {
    string imageName = trackedImage.referenceImage.name;
    if (!_trackers.ContainsKey(imageName)) continue;
    Destroy(_trackers[imageName].gameObject);
    _trackers.Remove(imageName);
    }
    }
    }
    public class TrackerModel : MonoBehaviour {
    public string Name;
    public string ImageName;
    }
    This way, the prefab and the image don't have to have the same name.
    Btw, thanks for this!

  • @pedrodavid2599
    @pedrodavid2599 ปีที่แล้ว +2

    Hi, everyone. I have an issue. I made the app and it runs perfectly, the camera it's starting normally on the app at my mobile device, but when I point it to the anchor image, nothing happends, the cube does not appear above it. Does anyone knows how I fix that, pls?

    • @henrikjorgensen6850
      @henrikjorgensen6850 ปีที่แล้ว

      Hello Pedro
      I have the same problem, I just opdt. to the new version (2022.1.20f1) Have you solved your problem?

  • @mairem
    @mairem 11 หลายเดือนก่อน +1

    why does the unity version switch halfway through? many things are not compatible in the 2022 version and that's not mentioned

  • @daniamohammad1596
    @daniamohammad1596 ปีที่แล้ว +1

    hello sir, I hope you do not mind, but is it possible that you could share the C# script, please

  • @jayaxell
    @jayaxell ปีที่แล้ว +1

    im having an issue where the object that im placing keeps floating everywhere... anyone knows why?

  • @user-rj1hx3gw2b
    @user-rj1hx3gw2b ปีที่แล้ว +2

    using System;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR.ARFoundation;
    using UnityEngine.XR.ARSubsystems;
    [RequireComponent(typeof(ARTrackedImageManager))]
    public class PlaceTrackedImages : MonoBehaviour
    {
    // Reference to AR tracked image manager component
    private ARTrackedImageManager _trackedImagesManager;
    // List of prefabs to instantiate - these should be named the same
    // as their corresponding 2D images in the reference image library
    public GameObject[] ArPrefabs;
    private readonly Dictionary _instantiatedPrefabs = new Dictionary();
    void Awake()
    {
    // Cache a reference to the Tracked Image Manager component
    _trackedImagesManager = GetComponent();
    }
    void OnEnable()
    {
    // Attach event handler when tracked images change
    _trackedImagesManager.trackedImagesChanged += OnTrackedImagesChanged;
    }
    private void OnDisable()
    {
    // Remove event handler
    _trackedImagesManager.trackedImagesChanged -= OnTrackedImagesChanged;
    }
    // Event Handler
    private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs)
    {
    // Loop through all new tracked images that have been detected
    foreach (var trackedImage in eventArgs.added)
    {
    // Get the name of the reference image
    var imageName = trackedImage.referenceImage.name;
    // Now loop over the array of prefabs
    foreach (var curPrefab in ArPrefabs)
    { //AreaEffector2DPrefabs
    // Check whether this prefab matches the tracked image name, and that
    // the prefab hasn't already been created
    if (string.Compare(curPrefab.name, imageName, StringComparison.OrdinalIgnoreCase) == 0
    && !_instantiatedPrefabs.ContainsKey(imageName))
    {
    // Instantiate the prefab, parenting it to the ARTrackedImage
    var newPrefab = Instantiate(curPrefab, trackedImage.transform);
    // Add the created prefab to our array
    _instantiatedPrefabs[imageName] = newPrefab;
    }
    }
    }
    // For all prefabs that have been created so far, set them active or not depending
    // on whether their corresponding image is currently being tracked
    foreach (var trackedImage in eventArgs.updated)
    {
    _instantiatedPrefabs[trackedImage.referenceImage.name]
    .SetActive(trackedImage.trackingState == TrackingState.Tracking);
    }
    // If the AR subsystem has given up looking for a tracked image
    foreach (var trackedImage in eventArgs.removed)
    {
    // Destroy its prefab
    Destroy(_instantiatedPrefabs[trackedImage.referenceImage.name]);
    // Also remove the instance from our array
    _instantiatedPrefabs.Remove(trackedImage.referenceImage.name);
    // Or, simply set the prefab instance to inactive
    //_instantiatedPrefabs[trackedImage.referenceImage.name] .SetActive(false) ;
    }
    }
    }

    • @VictorNiebla
      @VictorNiebla ปีที่แล้ว

      The real hero in the entire comments section! 🙏

  • @IlanPerez
    @IlanPerez 6 หลายเดือนก่อน +2

    after watch the first 2 minutes of this video I am so excited to dig in.

  • @Moki314
    @Moki314 ปีที่แล้ว +3

    I need some help. I was able to build & run the app, but when I point the camera at the reference, my object doesn't show up. The reference I'm using is an 8x8 grid of black & white squares which should be pretty easy to recognize, and is about 180 x 180mm for the entire grid, so decently large. I'm using a Samsung Galaxy S8.

  • @andreasilvestri4745
    @andreasilvestri4745 2 ปีที่แล้ว +2

    Hi, thank you to share this amazing video. I have the black screen when i run the app on my smartphone (Galaxy S8 - Android V.9). I do not why the camera not working. Unity Editor version used: 2021.3.7f1

    • @yi8634
      @yi8634 2 ปีที่แล้ว

      I have the same problem! Don't know how to resolve it.

    • @lucasfellipemondinipereira1099
      @lucasfellipemondinipereira1099 2 ปีที่แล้ว

      @@yi8634 you have forgot to anable the arcore

    • @qisthial882
      @qisthial882 ปีที่แล้ว

      @@lucasfellipemondinipereira1099 hi I already did that but it still doesn't work for me. any other suggestion?

    • @nuelaenebechi6861
      @nuelaenebechi6861 ปีที่แล้ว +1

      @@qisthial882 please did you solve this? I am having the same problem

  • @ab_obada5012
    @ab_obada5012 ปีที่แล้ว +1

    it was better to code explain instead of copying code

  • @annexgroup6878
    @annexgroup6878 2 ปีที่แล้ว +10

    This is so amazing. I can't thank you enough for providing an updated tutorial. I was getting so frustrated with my projects. Good luck to everyone!

    • @junjun3987
      @junjun3987 ปีที่แล้ว

      have you got it?

    • @ab_obada5012
      @ab_obada5012 ปีที่แล้ว +1

      @@junjun3987 he does not because it is dumb to copy code without to write it and explain it at same time

  • @digisvgenix7236
    @digisvgenix7236 2 ปีที่แล้ว +1

    Plz tell or give description link it is my earliest request

  • @x2blader
    @x2blader ปีที่แล้ว +1

    I got the app to build, but it doesn't seem to recognise the images...the video it's supposed to play won't play. Please help

  • @bennguyen1313
    @bennguyen1313 2 หลายเดือนก่อน

    Any changes to the AR Tool landscape since this video was made? For example, Flutter , ARLoopa, or Flet/ARCore ?
    I'd like to make an Android application that can find components from a circuit board! Just use your camera and it will overlay a marker on the component... however, not sure if there is a minimum marker size , and if it can be overlayed with such high precision.
    For example, if you have a sheet of paper with a grid of squares, say 50x50.. if A4 is said/entered, could AR use a fiducial on the paper to calculate how far into the grid it needs to place a marker (scaling it based on the the angle and how close the camera is to the sheet).

  • @rekiallard77
    @rekiallard77 3 หลายเดือนก่อน

    Hi Sir, I am very new to SDK and AR. I am confused about determining the SDK, which device is suitable for it. I always encounter errors when I want to build an application. I hope you make a tutorial about SDK and Unity 2017 because this version is the best in my opinion and the beginning of AR being implemented in unity.

  • @henryqng
    @henryqng 2 ปีที่แล้ว +4

    I watched many AR tutorial on TH-cam, but most of them were outdated or hard to understand. Thanks for this detailed Unity AR tutorial. I have just liked and subscribed to your channel. Would you please create a tutorial on how to rotate and scale different objects after instantiating the 3D models in the AR scene? Cheers!

    • @annexgroup6878
      @annexgroup6878 2 ปีที่แล้ว

      This is exactly what I was thinking

    • @Popstudioztuts
      @Popstudioztuts ปีที่แล้ว

      @@annexgroup6878 did you find it?

  • @noahberlanger9316
    @noahberlanger9316 2 ปีที่แล้ว +3

    ty for the vid but where is the script link?

    • @davesage6743
      @davesage6743 2 ปีที่แล้ว

      I just posted his link for it

  • @AhimsaCreative
    @AhimsaCreative ปีที่แล้ว +1

    so how does one find the script? I even joined the patreon nut it was impossible to find - seems very strange that there are no direct links

  • @davefrancis4970
    @davefrancis4970 3 หลายเดือนก่อน +1

    That's a fantastic explanation and thanks very much !

  • @deedd4401
    @deedd4401 3 หลายเดือนก่อน

    given how fast everything changes.... i would like to ask , is the most of the information still relevant ? I'm sure the process might have stayed somewhat same, but unity could have changed, plugins, detection algoriddims .. etc etc .... so not questioning the validity of the advice provided , just wondering on how rather applicable it is - given the tools are up to date.

  • @justshortstoday
    @justshortstoday หลายเดือนก่อน

    i am beginner to everything and i made it all the way to end of the video. i am having troubles on how to run it in the device and also the saved apk is not showing up on my pc. Instead when I search, it says file not found/cant open.

  • @Ta-nw9cj
    @Ta-nw9cj 4 หลายเดือนก่อน

    The associated script cannot be loaded. Please fix any compile errors and assign a valid script.
    in Play Tracked Images

  • @NafiurRahmanYT
    @NafiurRahmanYT ปีที่แล้ว +1

    hey, the code is not in the video description...

    • @batvanio
      @batvanio ปีที่แล้ว +2

      Here is the code. I got it from a forum. Turns out it doesn't work with android under version 7, and my phone is version 6.
      drive.google.com/file/d/1N6Txdtq8pCGTEndZImSdNOowvY4nBAs1/view?usp=sharing

    • @bonkeronline
      @bonkeronline 11 หลายเดือนก่อน +1

      thank you@@batvanio

  • @HumbleHustle101
    @HumbleHustle101 หลายเดือนก่อน

    Hi, Nice video, Can you demonstrate a case where the augmented reality game uses objectron object detection to sense the direction of the object with respect to the movement of the object. A usecase can be there is a car toy and based on the objectron users can see certain effects like turbo and smoke based on the object velocity at the correct position i.e. at the rear always.

  • @pelagato
    @pelagato ปีที่แล้ว +2

    La solución para quienes no les arroja error y aun así el cubo no se ve, desde el min 9:22 en la parte super, donde sale la versión de Unity 2022.1.51f, esta cambia a Unity 2021.3.4f1. Hice el cambio de versión con los mismos pasos y logre ver el cubo en el marker.
    _
    The solution for those who do not get an error and even so the cube cannot be seen, from min 9:22 in the super part, where the version of Unity 2022.1.51f comes out, it changes to Unity 2021.3.4f1. I did the version change with the same steps and I managed to see the cube in the marker.

    • @sgt328
      @sgt328 ปีที่แล้ว

      you might be correct, trying this

    • @DeafStud
      @DeafStud 11 หลายเดือนก่อน

      @@sgt328 did it help?

  • @loreleipepi3389
    @loreleipepi3389 ปีที่แล้ว +2

    Thanks for the excellent tutorial! Like many others, I use iOS and have had the black screen and Unity crashing issues. Some people suggest that it's resolvable with activating and updating the ARKit /ARCore. Mine were already in place and updated, and it wasn't until I downloaded and imported the entire Unity AR Foundation package that I was able to do image tracking and have the camera work. They have samples built in to the Foundation package. There are a lot more scripts!

  • @get_seb
    @get_seb 2 ปีที่แล้ว +1

    I wanna ask for the tracking of the images, is there any limitation where by the colour must match? lets say the image library we gave a colour image but we track a monochrome image. Does it work?

  • @mystro1112
    @mystro1112 4 หลายเดือนก่อน

    Love your videos but to be honest this one is a little too technical as i am not a coder and want to create an AR app for my college Treasure hunt the one which you released a few years ago i could follow that and create a simple AR app this one is way more confusing and technical

  • @trexnfabianndenis
    @trexnfabianndenis 11 หลายเดือนก่อน +1

    I started out with an escape room and now i'm back in school studying electronics-IT.. All thanks to your videos my friend 🙏

    • @PlayfulTechnology
      @PlayfulTechnology  10 หลายเดือนก่อน

      Oh wow - that's so awesome to hear!

  • @hariswidianto2416
    @hariswidianto2416 ปีที่แล้ว +1

    BROTHER, YOU ARE THE BEST!!! You oooh really helped me!! THANK YOU VERY MUCH!

  • @JuneMendoza-q1r
    @JuneMendoza-q1r 19 วันที่ผ่านมา

    Johnson Michael Brown Robert Lewis Mark

  • @Allopedia
    @Allopedia 2 ปีที่แล้ว

    I watched tNice tutorials 18 minute video for like 2 hours.

  • @WalrusesAreTheOne
    @WalrusesAreTheOne 2 ปีที่แล้ว +2

    You said you would paste a link for the code, but I don't see it.

  • @statixbolt
    @statixbolt ปีที่แล้ว +1

    App kept crashing I have no idea why, pls help

    • @hackur4659
      @hackur4659 ปีที่แล้ว +1

      yes dude

    • @hackur4659
      @hackur4659 ปีที่แล้ว +1

      what did you do ??

    • @statixbolt
      @statixbolt ปีที่แล้ว

      @@hackur4659 Idek

    • @hackur4659
      @hackur4659 ปีที่แล้ว +1

      @@statixbolt so basically you left?🙄

    • @statixbolt
      @statixbolt ปีที่แล้ว +1

      @@hackur4659 Nah Instead I just used ARCore, I'm working on an OS for AR glasses and just thought this would be an easier approach, but it didn't work

  • @SuperFunCentral
    @SuperFunCentral หลายเดือนก่อน

    How do you deploy the app if you are using an iPhone with iOS?

  • @Br4d327
    @Br4d327 2 ปีที่แล้ว +1

    Hi, does it work with multiple pictures? It is only recognizing the first image.

    • @nuruluin9840
      @nuruluin9840 ปีที่แล้ว

      did you fix this? im loosing my mind with the same issue

  • @Yo-bh5vm
    @Yo-bh5vm 4 หลายเดือนก่อน

    Is there a way to enable the record button in the app when the image shows?

  • @paulmiddleton705
    @paulmiddleton705 ปีที่แล้ว +1

    I had an issue with the Android phone not putting the 3D image over the anchor. Not sure what helped exactly. But potentially it might have been due to the size of the cube being too large to fit within the screen area. It was 1m3 and worked after I adjusted to be 0.1m3. Hope that helps someone else

  • @theguanche
    @theguanche 2 ปีที่แล้ว

    Sa

  • @engcisco
    @engcisco 2 ปีที่แล้ว +1

    Many thanks for the great video, is it possible to export it for web using WebGL? is it supported?

  • @ARafee
    @ARafee 2 ปีที่แล้ว +1

    Very useful video and comments. I built the app -- works all the way, except when I point iphoneX on the card, the cube does appear but for a nano second and then disappears -- it does not stay. The app keeps trying to bring the cube, but cube never sticks. Any idea what I may be missing?

    • @gardendesignerapp
      @gardendesignerapp 2 ปีที่แล้ว +1

      There appears to be an issue with ARTrackedImagesChangedEventArgs updated in ARKit. If you just remove the code for the foreach loop that covers eventArgs.updated then it should work fine.

    • @pretzelmunster
      @pretzelmunster ปีที่แล้ว

      @@gardendesignerapp Wow, that was a life saver on iOS, thanks a lot!!!

  • @diositoop1355
    @diositoop1355 ปีที่แล้ว +1

    Hi guy where is the code? i write letter for letter and have a error, i want see if is my unity or my code

    • @diositoop1355
      @diositoop1355 ปีที่แล้ว

      @@henrikjorgensen6850 ty man

  • @lulupont
    @lulupont 8 หลายเดือนก่อน

    this is amazing, great tutorial. but what if I dont want to depend on a single device? what if I want to make it web based? working for android and IOS?

  • @jacobkerr6714
    @jacobkerr6714 2 ปีที่แล้ว +2

    I have followed this tutorial closely but I just get a black screen when I run it (clicking play at the top of the unity). Does anyone have any ideas of what the issue could be? I get this error in the consol "No active UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings." But I don't undersand because I have selected ar core on my within the xr plugin management tab. When I try to upload to my phone nothing seems to happen either? Any adivice would be very appreciated.

    • @gangabs2896
      @gangabs2896 2 ปีที่แล้ว +1

      same error

    • @AS-dn3wc
      @AS-dn3wc 2 ปีที่แล้ว

      You will have go to "Window Option" then go to "package Manager" and click on the option "XR management" n there click on this Window icon and tick "ARCORE" there....

    • @ap2402
      @ap2402 ปีที่แล้ว

      @@gangabs2896 me too

    • @loreleipepi3389
      @loreleipepi3389 ปีที่แล้ว

      @@AS-dn3wc Thanks, I saw this as a potential fix online, but I already have it enabled. I wonder if it's an iOS issue.

  • @kristapsspatsirk
    @kristapsspatsirk 10 หลายเดือนก่อน +1

    Great video! Im stuck at this moment... How can I use image tracking in XR Enviroment simulation? Now I get error from line of code "_instantiatedPrefabs[trackedImage.referenceImage.name].SetActive(trackedImage.trackingState == TrackingState.Tracking);" in foreach update

  • @amarprakash7403
    @amarprakash7403 ปีที่แล้ว

    getting a particular error while build ad run -->>> UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors

  • @World_of_Legends597
    @World_of_Legends597 4 หลายเดือนก่อน

    hi, where can I get strong knight folder

  • @zachheaven
    @zachheaven 2 ปีที่แล้ว +3

    THIS IS TOTALLY AMAZING. Ive always wanted to start studying AR and this was the perfect jumping off point. One question i had was where could we find the script put into visual studio at the 16 min mark?

    • @zachheaven
      @zachheaven 2 ปีที่แล้ว

      found it. theres a link to the description at the end which leads you to github. scroll down on that and youll find it

    • @pedrodavid2599
      @pedrodavid2599 2 ปีที่แล้ว

      @@zachheaven do u still got it? I couldn't find it

    • @theharmont7390
      @theharmont7390 2 ปีที่แล้ว

      @@pedrodavid2599youtube does not allow you to send links :(

    • @kinga.b.1709
      @kinga.b.1709 ปีที่แล้ว

      ​@@theharmont7390 , Hello! Could you add this link to the description of your latest video on your channel?

    • @hellhxxoundss1930
      @hellhxxoundss1930 10 หลายเดือนก่อน

      im making this for a project .. can u please send the link via any social media site .. i reall need that line of code .. thanks@@theharmont7390

  • @decayingsofacinema-relaxin6072
    @decayingsofacinema-relaxin6072 ปีที่แล้ว

    dear boss, when I follow your guide, when in "install" step, I install the "Unity 2022.3.2f1", but there are only 3 topic under that: they are "editor application""documentation""webgl build support"... there is no "android" or "ios build" option... strange...

  • @samrat_malisetti
    @samrat_malisetti 3 หลายเดือนก่อน

    Can we develop this application in Mac? Does Mac support Unity development?

  • @muhammadyusoffsulaiman6903
    @muhammadyusoffsulaiman6903 ปีที่แล้ว

    Im just a regular language teacher trying to help my students who have difficulties in basic reading and writing.
    I have no basic in programming.
    th-cam.com/video/xrxyHxXFzXM/w-d-xo.html
    This card i tried using free version of online site. But its limited since it is free version.
    Im trying to learn on creating AR Phonics Card to help my students.
    How can i adjust the Video on the Card so that the video will only play on top of the students image only like my video in the link, by using Unity 2022?

  • @x3Charlotti
    @x3Charlotti 2 ปีที่แล้ว +5

    Everything works, thank you.
    But my phone doesn't recognize the reference images. What am I doing wrong? Does anyone have a tip?

    • @bruhbeat3047
      @bruhbeat3047 2 ปีที่แล้ว

      hi did you solve this problem, been hard stuck on it 😢

    • @maxechendu6693
      @maxechendu6693 2 ปีที่แล้ว

      Same issue here, did you find a solution?

    • @pedrodavid2599
      @pedrodavid2599 ปีที่แล้ว

      I have the same issue. The app runs perfectly, the camera opens, but when I point it to the anchor, nothing happens. Have u guys found a solution? I would be glad to know.

    • @bruhbeat3047
      @bruhbeat3047 ปีที่แล้ว

      Did you drag the prefabs into script components?

    • @pedrodavid2599
      @pedrodavid2599 ปีที่แล้ว

      @@bruhbeat3047 I did. I followed the tutorial and it worked. The app was downloaded, the camera opened, but when I point the camera to the image that it's supposed to be replaced, nothing happends.

  • @DaftFrik
    @DaftFrik 2 ปีที่แล้ว +5

    Hey, I followed the tutorial closely, but when I run the app on my phone, I only see a black screen. Searching around, the common advice for this is enabling ARCore in XR Plug-in Management but I have already done that. Any suggestions for what the problem may be?

    • @pil_low
      @pil_low 2 ปีที่แล้ว

      Deleted the main camera?

    • @dkm3025
      @dkm3025 2 ปีที่แล้ว +1

      did you add the scene in the build settings?

    • @andreasilvestri4745
      @andreasilvestri4745 2 ปีที่แล้ว

      Did you solve the problem? I have the same issue. 😫

    • @DaftFrik
      @DaftFrik 2 ปีที่แล้ว

      @@andreasilvestri4745 I had to use a proper build, it didn't work with unity remote

    • @andreasilvestri4745
      @andreasilvestri4745 2 ปีที่แล้ว

      @@DaftFrik i built the apk and installed on my smartphone. What you mean with proper build? Thank you very much.

  • @davestr2046
    @davestr2046 7 หลายเดือนก่อน

    Is this the beginning of the end of that horrible, over-priced Vuforia? Like that clunky Wikitude. One can only rejoice.

  • @Roadrunner_KZSK
    @Roadrunner_KZSK 10 หลายเดือนก่อน

    Works well until I get like half a meter (1.6ft) away from the image with my camera, in other words, the image has to take up at least like 20% of my camera video feed to work correctly. As soon as I "zoom out" the tracking is lost. Tested it with different markers and different light setups but that doesn't seem to be the issue.
    Is there a way to fix this? Perhaps a fundamental setting I'm missing? I've set the tracked images physicla size in my ReferenceImageLibrary asset but that did seemingly nothing.

  • @muhammadhafizh7863
    @muhammadhafizh7863 2 ปีที่แล้ว

    understanding how everytNice tutorialng works. TNice tutorials is like my 10th ti watcNice tutorialng tNice tutorials lol I’m so basic!

  • @TripwithCharlien666
    @TripwithCharlien666 ปีที่แล้ว

    Hello, great tut!! now, how can we test/run our oriject thru the cellphone, mine says something regarding USB cable and Unity instructions u.u

  • @saqbsaq9002
    @saqbsaq9002 9 หลายเดือนก่อน

    is unity 2022.3.13f1 version is not available for developing android?

  • @АнтонийСердюков
    @АнтонийСердюков 7 หลายเดือนก่อน

    My model appears and disappears but it looks to be connected to the phone not the image. Tried to update the packages, changing the API level. Any suggestions?

  • @bedirhanyelkovanc5422
    @bedirhanyelkovanc5422 2 ปีที่แล้ว

    both the GMS and softEX setup is very different from the one ur using.. why is it so.? GMS doesn't even soft like a app one... and the

  • @rdvn_ckc
    @rdvn_ckc ปีที่แล้ว

    Hello friends, I am making an application with augmented reality in unity. When I build my application for windows, the pc min camera does not turn on, how can I solve it? can you help me?

  • @jmjb67
    @jmjb67 2 ปีที่แล้ว +1

    Really great instructional video. It is up-to-date (Oct 2022), thorough, comprehensive, well-paced and concise.
    (and look, Ma: no vuforia!) :)

  • @Oh_Deardiary
    @Oh_Deardiary ปีที่แล้ว

    Tip : if you are doing it with him....then the code isn't available in the description.... slow down the video take pics and type everything.

  • @rsauchuck
    @rsauchuck ปีที่แล้ว

    The update event OnTrackedImagesChanged causes the placed prefab constantly Activate/deactivate because my prefab obscures the tracked image. How do i fix this?

  • @AhmadFaraz-bb9tp
    @AhmadFaraz-bb9tp ปีที่แล้ว

    As you have said ar session origin will be changed to xr origin they did exactly the same in the lattest version of 2022 LTS.

  • @maxmason75
    @maxmason75 ปีที่แล้ว +1

    Hi everyone! Thank you so much for this tutorial, was super awesome! When I went to build this on my iPhone I got a build error stating "Undefined symbol: _UnityARKit_Camera_GetTextureReleaseCallbackHandle" Any thoughts on how to fix this? Thanks in advance anyone!

    • @pretzelmunster
      @pretzelmunster ปีที่แล้ว

      What a coincidence, I have the same one ;-( In case you got this fixed, please let us know!!!

    • @pretzelmunster
      @pretzelmunster ปีที่แล้ว

      Ok, found it. I manually updated AR Foundation to 4.2.7 (had to unlock it) and then it finally compiled without this error!
      On iOS please also see this great comment below in case the image is only replaced for a blink of an eye:
      gardendesignerapp:
      There appears to be an issue with ARTrackedImagesChangedEventArgs updated in ARKit. If you just remove the code for the foreach loop that covers eventArgs.updated then it should work fine.

    • @maxmason75
      @maxmason75 ปีที่แล้ว

      @@pretzelmunster Nice thanks for the tip. But I cant even get this project to build now. I go to build settings, then build and it just trys to build for a sec and stops. I opened up another AR unity project and just built it straight away and it worked so I'm guessing its something in the scripts or other build settings thats blocking it. I dont know :(

    • @jjaylee6095
      @jjaylee6095 ปีที่แล้ว +1

      where to get the code

  • @binwang1798
    @binwang1798 ปีที่แล้ว

    Hi, guys, did you find the code from description? Why I cannot find it. thanks in advance for your feedback

  • @ThePsylogic
    @ThePsylogic ปีที่แล้ว

    Hi! I am getting the following error when i try to edit the custom script. "The document PlaceTrackedImages.cs could not be opened. You dont have permission." How do i reslove this?

  • @asfandyarfarooqi0166
    @asfandyarfarooqi0166 ปีที่แล้ว

    Hey it's an amazing tutorial but is it necessary to build and run? Can't I copy the APK to my phone and install it?
    Actually doing so is causing the app to crash on launch

  • @nuruluin9840
    @nuruluin9840 ปีที่แล้ว

    it wont work, for some reason it only works with the first object and image, I'm loosing my mind trying to make a simple ball appear, the cube is perfect but I cant get the ball to appear for my life

  • @simoncotroux7967
    @simoncotroux7967 ปีที่แล้ว

    I have a question about when you deploy the project. How to give it to end users? Because ok you can do a showcase with your phone, but after that ? The only way is to install the .apk on their (rooted/debug/dev mode active/jailbreak) devices ? :S (nobody know how or agreed to) Or there is another friendly way ? like "click this link and download this friendly project" or maybe something like apkpure etc... and what about apple :s ?
    ?

  • @Noah-uu2jl
    @Noah-uu2jl 2 ปีที่แล้ว

    He's clicking everywhere and he knows what every button does. clicking by mistake " where did it go?!?!" Start pressing random keys

  • @martinluterelectronics8619
    @martinluterelectronics8619 2 ปีที่แล้ว

    I'm pretty sure I'm not gay, but tNice tutorials man with Nice tutorials damn handso voice is sure ly about to change that lmao

  • @mertkonti5428
    @mertkonti5428 2 ปีที่แล้ว

    I'm pretty sure I'm not gay, but tNice tutorials man with Nice tutorials damn handso voice is sure ly about to change that lmao

  • @soefatitv9264
    @soefatitv9264 2 ปีที่แล้ว

    I rember coming here for the first ti tNice tutorialnking "oh sNice tutorialt... tNice tutorials is gonna be one a long day..."

  • @r.r.divanarindranidaniella3543
    @r.r.divanarindranidaniella3543 2 ปีที่แล้ว

    Between Producer and Signature, wNice tutorialch SKU would you recomnd? Is Signature worth the 50% price bump? ItNice tutorialnk I want to have

  • @gsg143
    @gsg143 ปีที่แล้ว

    Sir I learn how to creat an ar app from you now iam developing it I need to know how to connect unity Android app connect to the Arduino hc05 bluetooth to control the game so please 🥺 make a tutorial on that please

  • @joaoprata4065
    @joaoprata4065 7 หลายเดือนก่อน

    Finally what i've been serching for so long. Subscribed! Is there a way to publish your AR experiences so that you can share on social media?

  • @kotraner
    @kotraner ปีที่แล้ว

    1:38 is it real that using image tracking in ar foundation support? because I made image tracking sample code, but it dosen't seem as good as you show in 1:38