Object moving with camera


#1

Hey,
I’ve downloaded the SDK and followed your tutorial but, when i put an object in the scene. The object is attached to camera i.e. where i look the object will follow but, i want the object to stay where it is. Does require the ground plane as i just added the object to the hierarchy.

Thanks


#2

I need a little more information, what tracking engine do you use? ARCore / ARKit / Vuforia / something else?


#3

I am using Vuforia


#4

Alright, make sure the object is at the root of your hierarchy, so not inside the ARCamera or Aryzon object otherwise it will move with the camera. Also make sure you have entered your Vuforia developer key in the configuration file otherwise Vuforia will do nothing at all. And make sure to setup the Aryzon object to follow the transform of the ARCamera object by dragging it into the ‘transform to follow’ and select to follow Vuforia in the dropdown menu.


#5

I have done that but it still doesn’t work. I have moved to your basic example, the example works in the editor however, on the phone the only thing displaying is the dot.


#6

That’s strange, what type of phone are you developing on? I assume you have looked around, sometimes the object is ‘behind’ you. Does image target detection work? Unity does not give any errors are other warnings?


#7

I am not using the image detector instead i am using the ground plane and just for testing as mentioned earlier. I have the ARCamera in the Aryzon prefab and following. I’ve put a cube in the hierarchy, not as a child of anything but just by itself. This is still following the camera, or maybe I misunderstood you when you said root of the hierarchy. I want to achieve something similar to the hexagon application (one of the AR appliaction of Aryzon).


#8

I think ‘following the camera’ actually means the camera does not move at all. It is hard to check what is going on without seeing the actual project. Can you zip it and send it to me so I can have a look?


#9

I see, okay thank you for your help Maarten, I’ve attached the project with a good drive link. :slightly_smiling_face:
Unity Project


#10

I have tested the project on iOS and I see the issue you are having. I then created a new project with only Vuforia ARCamera and a cube. This project had the same error so this seems to be an issue with Vuforia.

I had to download Unity 2018.3.9 and update my Vuforia to be able to build your project. Sometimes things break when updating to the latest versions, I know, this sucks. Internally we have started using Unity Hub so we can test out new Unity and Vuforia builds before they are stable enough.

This problem seems to be out of our control, I can only suggest using an older version of Vuforia and / or Unity. We work with Unity 2018.3.0 and Vuforia 8.0.10.


#11

Okay, i will downgrade and test.
Thank you so much for your help


#12

No problem, hope you get it to run properly


#13

It works to a certain degree. I’ve changed unity however, could not find a older version of Vuforia. But, I got the rotation to work using a simple gyroscope script. In other words, I’ve attached a gyro script to each camera and the rotation works.

I was wondering if you know anyway of getting the position, moving around the object?
would it be as simple as using:
var cameraPos = Camera.main.transform.position;

or is there a script in the SDKi could use?


#14

You will need to use ARCore for Android or ARKit for iOS for positional tracking. Their sample Unity projects are quite clear. It’s pretty easy to add the Aryzon SDK but I’d suggest getting it to run without the Aryzon SDK first to see if your phone supports positional tracking.


#15

Okay, I will have a go at ARCore. Once again thanks for your help!


#16

Sorry to bring up this post again, but I’m having a similar issue: I’m trying to combine ARCore 1.7.0 and Aryzon in Unity 2017.4.24f1 with an original headset (2017).

I want to track an image target and have a model appear in front of it when viewed through Aryzon.

Everything works except when I’m looking through the headset - the object does not seem to stick to the image target, but when I take it out of the headset, I can see the “two” objects staying in place. The tracking also works just in ARCore mode.

This is a strange viewing issue, right?


#17

Hello Sarah,

This may sound stupid but it is worth a try. When you put on the headset are putting the marker in front of your eyes or the camera? as the phone is positioned under your field of view (eyes). Have you tried using a later version of unity? I am current using 2018 version and 2019.

Abdul


#18

Hi Sarah,

Have you setup the Aryzon object to follow the ARCore camera object? If it’s not set to follow anything it will stay at 0,0,0 while ARCore mode does work.

Edit, this might help, instead of using the Main Camera you should use the ARCore camera object (First Person Camera):

Maarten