Log in or register to post comments

Freeze GameObject position with a virtualbutton

June 17, 2021 - 9:37am #1

Hello,

I am fairly new to Vuforia and I am trying to create a board game where you place physical objects  with imagetargets  in physical space that have a 1 to 1 translation to a gameobject in Unity. I want to create a virtual button that when pressed, the tracked GameObject freezes (Position and rotation).

Does anyone have any tips on how to achieve this?

 

Thank you!

 

Argyrios

Freeze GameObject position with a virtualbutton

June 20, 2021 - 4:37am #3

Hello,

 

thank you for the reply!

So I have multiple image targets that correspond to unique gameobjects(walls and floor slabs). You basically play a lego-like board game and every piece has an imagetarget so as you play on physical space there is a copy of the flat you are designing in unity.  What I would like to achieve is to track the imagetarget(wall or slab), generate the augmented object and then freeze its position meaning keeping it unmovable in the xyz axis and its rotation on the virtual space.  So at the end I have multiple gameobjects next to each other (they are walls and floor slabs, its a design your own flat board game basically), and i can export a file that is the flat.

When I freeze/lock in position  the augmented target I want it to be stored in a specific xyz position on the virtual space and not care about if the piece is still tracked or not.

I am trying to write a C# script but I cannot find a way to obtain the child Gameobject of the imageTarget (Trying to find it through the Vuforia API) and then make it stop moving around and also stay in position even when the imagetarget is not tracked anymore.

 

Regards,

 

Argyrios

Freeze GameObject position with a virtualbutton

June 18, 2021 - 8:50am #2

Hi,

if you could explain more detailed what is here your intent when you say freeze. So far I understood your description you will use image target to place an object on e.g. plane. Then you want to freeze the object - I think here (but not sure) you want to letthe object on the position on the image target then set / fix the position  click on button and then move the image target to other position for placement of further object.

In this case I think you can check the ground plane functionality, which is allowing virtual content to be placed on horizontal planes in the environment

You can review the following article , which could be helpful in this case

1.)Introduction to Ground Plane in Unity

2.) Best Practices for Continued AR experiences

3.) you can also review the functionality  of the Vuforia Engine Core Example so you can review the Vuforia Core Samples

   3.1.) you can check the scene 3-GroundPlane in folder     Assets\SamplesResources\Scenes to see  an example how to ground plane is used

   3.2) you can check the scene 3-VirtualButtons in folder     Assets\SamplesResources\Scenes to see an example for the usage of Virtual button with Vuforia Engine

 Best Regards

Vuforia Engine Support

Log in or register to post comments