Slide 44
Slide 44 text
Script
if (Frame.Raycast(touch.position.x, touch.position.y, filter, out hit))
{
// If pointed trackable is plane
if (hit.Trackable is DetectedPlane )
{
//Set the position and the angle of Andy
andy.transform.position = hit.Pose.position;
andy.transform.rotation = hit.Pose.rotation;
andy.transform.Rotate(0, 180, 0, Space.Self);
//Set the anchor to fix Andy object to real space.
var anchor = hit.Trackable.CreateAnchor(hit.Pose);
andy.transform.parent = anchor.transform;
}
}