Vive Instantiate an prefab directly in hand.

is it possible to instantiate a prefab directly into the controller hand by grabbing another in game object?

Example; If my wand ( hand ) grabs a statue of a snake, can that on trigger event from that spawn a completely different prefab ( snake npc) in hand?

heres what I have so far,

public class Spawnontouch : MonoBehaviour { public GameObject Snake; public SteamVR_TrackedObject Controller;

void OnTriggerEnter(Collider col)
{
Debug.Log(“Detected on trigger”);
}

void OnTriggerStay(Collider col)
{

Debug.Log(“it picked up the statue tag”);
var device = SteamVR_Controller.Input((int)Controller.index);
if (device.GetTouchDown(SteamVR_Controller.ButtonMask.Grip))
{
Debug.Log(“it picked up the grip button being entered”);
Instantiate(Snake); // <---- obviously where it goes.
}

}

}

the snake does spawn in some random part of the world, so the script is functional, however I was the snake to spawn directly in the players hand, in place of the right hand controller to be exact.

Any help or guidance would be appreciated.

You also need to set the position and rotation of the new object, and probably also the parent, assuming you want the snake to follow the wand.

Something like this:
Instantiate(Snake, .transform.position, Quaternion.identity, .transform);

Source: Unity - Scripting API: Object.Instantiate