Search Unity

Question AR Multiple Prefab Video Players

Discussion in 'AR' started by GrahamWild, Jun 3, 2021.

  1. GrahamWild

    GrahamWild

    Joined:
    May 6, 2021
    Posts:
    1
    Hi All,
    I have implemented multiple object tracking using two references:
    • Dev Enabled (
      )
    • Dilmer Valecillos (
      )
    The two are very similar in their implementation. I can track multiple objects nicely and deploy a single prefab using the built in AR Tracked Image Manager. However, when I change to either of the above codes (which work perfect for a generic 3D object), I have issues (I suspect due to Instantiate) when using one or more prefab video players.
    I have tried just about every possible prefab video player I can think of (cube with direct texture from video, quad direct, a canvas, a canvas on a cube, a canvas on a quad). Different things give different problems. Initially I wanted a Canvas solution, but the use of 3D objects in the above examples suggested I should use 3D objects.
    Since instantiate happens at awake, and the videos need to play on awake, this is a serious issue. As soon at the code is running, videos are playing off screen, with the audio present. The issue there is I cannot even get them to change position to the tracked object like the cubes with simple images (the other type of prefab I am using). To solve this, I added the canvas to the 3D objects and changed them to "World Space", but I am not at all confident with this solution so I don't know if I can't see the thing because I am not doing that properly, or it is just the same general rendering/spawning issue of the 3D object video player without a canvas.
    Again, the annoying thing is this works perfectly with the "AR Tracked Image Manager", where I note it does not use instantiate... it uses "get" but sadly my C# is not what it should be... (the intent was to use Vuforia, but there are bigger issues just getting that to work these days, was so easy to use in 2019 the last time I tried, and I had others using it last year for me).
    If anyone has any insights, I would be greatly appreciative. This has consumed most of my spare time for the last 2 weeks, at least 40 hours, and sadly that is not an over exaggeration.
    Specifically, I am using 2021.1 target to Android.
    Regards,
    Graham

    PS I hope help wanted is the correct prefix.