I've been trying this for a fw days now.I want to move the 3d object which is generated on the image target by tilting the image target printout.
I think I saw an implementation somewhere wehre the developer generated a maze game on a business card and the user could tilt the card to guide the game through the maze.I'm trying to achieve somthing similar.
So far,I tried creating a plane above the target but the ball would only stay static on it after it falls on it.The ball is a rigid body...
Also tried attaching the following js to the plane,ball and image target (one at a time and even combined) but it does not give the desired output
#pragma strict
var speed = 10.0;
function OnGUI()
{
if(GUI.Button(Rect(10,10,50,50),"X"))
{
Application.Quit();
}
}function Update ()
{
this.transform.position.x += -Input.acceleration.y/speed;
this.transform.position.z += Input.acceleration.x/speed;
}
Any help on how to achieve it would be greatly appreciated! And yes,I did search anc came up with just one thread with a similar problem ,however ,I think they decided to further discuss it in PMs so it didnt have the final solution or maybe I couldnt understand it for my lack of knowledge
Hi, I have found a way to achieve such an effect.
The trick is to set the world center to Device Tracking, and set the tracking mode to be rotational, so that the camera moves according to device gyro, while the image target can stay relatively still.
This is not the perfect solution, as there is always some offset in the image target angle, makes it not completely flat when it is resting on a flat surface. But the offset is usually within 10 degrees, so if you make a ball that ignores tilt within 10 degrees, it will work.