JagaFan
1
I got an empty game object with added plane child and it’s set to be TrackedImagePrefab.
Then I make a script to spawn the next prefab on buttonclick. and use this lane:
var item = Instantiate(Pointer, transform.parent);
Pointer is my prefab to spawn and script is attached to Plane
and prefab is instantiated on starting phone position, not parent position.
What is wrong?
JagaFan
2
For now I found solution like this, but i belive that better one exists
foreach (var trackable in _aRTrackedImageManager.trackables)
{
if (trackable.referenceImage.name == "uwm")
{
var item = Instantiate(Pointer, trackable.gameObject.transform);
item.transform.localPosition = new Vector3((float)((x + 0.5) * 0.1), 0, (float)((y + 0.5) * -0.1));
}
}