Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Help Please, I've a problem with my ar app

Discussion in 'AR' started by Bonnye, Aug 26, 2023.

  1. Bonnye

    Bonnye

    Joined:
    Apr 17, 2023
    Posts:
    7
    Hi,
    I will try to explain the problem in detail!
    I created a windows app that allows you to place markers on the surface of a 3D object imported into unity. Once the necessary markers (in green color) have been positioned, using the button at the bottom left, i am able to export their position and rotation within a json file. My ar app receives the json file as input and by scanning the markers on the real counterpart of 3d object, it should overlay the virtual 3d object. For positions seem to be no problem.
    The problem is with rotations. Can someone help me please?
    Some screenshots attached. Thanks
     

    Attached Files:

  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    And the issue is?
     
  3. Bonnye

    Bonnye

    Joined:
    Apr 17, 2023
    Posts:
    7
    hi, the problem is that the virtual object rotates and moves non-stop around the marker!
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Ah, that's not clear from images haha
    Which Unity version? (Latest 2021 and 2022lts and latest tech streams should have a fix for stability)
    You could try updating the AR systems you use.

    Is it on android? Generally android on unity has more drifting
     
  5. Bonnye

    Bonnye

    Joined:
    Apr 17, 2023
    Posts:
    7
    My unity version is 2022.2.18f1
    Yes, it's on android
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Upgrade to 2022 lts, might be better
     
  7. Bonnye

    Bonnye

    Joined:
    Apr 17, 2023
    Posts:
    7
    Hi, the problem is still the same
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Then it's an android issue for now. Forcing to 60 fps might help a bit, but there is no fix for drifting.
    If that's not the issue make a video
     
  9. Bonnye

    Bonnye

    Joined:
    Apr 17, 2023
    Posts:
    7
    I think I fixed the drift, but the angles are still wrong. the FPS are already set to 60. Video and new code attached
     

    Attached Files:

  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    It seems that the initial marker does spawn properly.
    So this your own code.
    Debug as much as possible to find out what's going wrong. Maybe using rotation instead of localrotation might be easier to match up rotations.
    And use code tags, not screenshots of code