Problem assigning transform variable to prefab.

I’m trying to have an object become parented to a character’s bone when the character touches the object. I have to do it a bit differently than the typical method however, because my character is a prefab that is created when the scene starts. Therefore, I can’t simply drag and drop the object in Unity to get it’s transform. Instead I am trying to assign the transform in script, but the examples that I have found for this don’t seem to work. Here is what I have so far:

var item : GameObject;
var itemTransform : Transform;
var boneTransform : Transform;

function Start()
     itemTransform = transform.Find("Item");
     boneTransform = transform.Find("CharacterBone");

function OnTriggerEnter (theCollision : Collider)
	if(theCollision.gameObject.tag == "Item")
             itemTransform.parent = boneTransform;

This seems to work just if I assign the itemTransform and boneTransform by hand after the scene starts, but unfortunately that’s not very convenient. Any ideas why the variables are not assigned on start?

Drag your prefab into scene (and zero it).

Assign your transform by dragging it.

Drag the whole object back into a space in the Project Manager to create a prefab that is now set up.

Transform.Find finds a child object on that transform.

If you want to search through all objects use GameObject.Find instead.