Log in or register to post comments

ARCamera/GameObject position

October 24, 2011 - 4:17am #1

Hi everyone,

i have the following hierarchy in the Unity project:
-ARCamera
--directional light
-FrameMarker0
--housemodell
-treasure

So, the housemodell is the GameObject to be shown when the FrameMarker is detected. The modell is loaded in runtime, everything works perfectly.

The treasure is an empty GameObject in the middle of the screen, it's modell is loaded in runtime from an assetbundle.

The whole program has a menu (iphone app), which controlls whether we want to show the modell on the marker ,or show the treasure modell in the middle of the screen.

The problem is:
If we show the house modell, then show the treasure modell (2 completely separate GameObjects with separate scripts), the treasure modell always shows up on the last marker position, not in the middle of the screen. I tried to move it with transform.position, localposition, itween, change its parent to ARCamera, nothing works.

Anyone has any idea how to solve this?

Thanks!

Re: ARCamera/GameObject position

October 24, 2011 - 8:07pm #2

I'm surprised changing its parent to ARCamera didn't work. An object parented to the camera and placed in front of it (within its clipping planes) should always show up in the same spot on the screen. That is, as long as the object isn't moving; make sure you don't have a rigidbody component with gravity enabled attached to it :)

You can also try setting the World Center Mode (on the ARCamera) to NONE. This will keep the camera stationary in the scene while the trackables move around it. As long as your treasure model isn't bound to a trackable it should keep its relative position to the camera.

- Kim

Log in or register to post comments