object not spawning but no error message

im trying to get a gameobject to spawn using these 2 scripts

(my trigger script)

function Update () {



       function ToggleTrigger () {
if (collider.isTrigger == true) {
		collider.isTrigger = false;
		collider.isTrigger = true;


(my send message/spawn script)

var sendToObject: GameObject;

var correctObject: GameObject; //this is the only object we allow to trigger the event

var targetFunction: String; // the name of the function to call

var prefab: Transform;

function OnTriggerEnter (object : Collider) {

   if(object == correctObject.collider) 
   		Instantiate (prefab, Vector3(0, 0, 0), Quaternion.identity);

function OnTriggerExit (object : Collider) {

   if(object == correctObject.collider) 

my issue is that my game runs with no errors but my prefab is NOT spawned, ive checked http://unity3d.com/support/documentation/ScriptReference/Object.Instantiate.html & http://unity3d.com/support/documentation/Manual/Instantiating%20Prefabs.html sections of unity for help and but to no real avail can any one help me?

The thing is, you don’t have braces around that if. It should do the Instantiate-method regardless of what hits it. Are you sure your colliders are set correctly for the trigger events to happen?

I cannot see the targetFunction method anywhere. Try reading through this