9 using System.Collections;
11 namespace Valve.VR.InteractionSystem
17 public GameObject itemPrefab;
23 hand = GetComponentInParent<Hand>();
30 if ( itemPrefab != null )
32 if ( hand.controller != null )
34 if ( hand.controller.hasTracking )
36 GameObject objectToAttach = GameObject.Instantiate( itemPrefab );
37 objectToAttach.SetActive( true );
38 hand.AttachObject( objectToAttach );
39 hand.controller.TriggerHapticPulse( 800 );
40 Destroy( gameObject );
44 objectToAttach.transform.localScale = itemPrefab.transform.localScale;