Question by
Gabriel-Rufino · Nov 27, 2019 at 11:43 PM ·
vrcontrolleraugmented reality
take objects from image target
So I've mixed two realities, augmented reality and virtual reality, and I'm working out a control whereby touching such an object causes this same object to stick to the target of the vuforia's target image. target image of the vuforia the object that stuck to my control disappears along.I need something that will make the vuforia control out of sight cause the scene object to get out of it keeping it in the scene. Can someone help me?
using UnityEngine;
using System.Collections;
public class PickUpObject : MonoBehaviour
{
public GameObject ObjectToPickUp;
public GameObject PickedObject;
public Transform Player;
private void OnTriggerEnter(Collider hit)
{
if (hit.tag == "Player")
{
PickedObject.transform.SetParent(Player);
PickedObject.transform.position = Player.position;
}
}
}
Comment