Hi there. I’ve searched through many questions around here and cannot seem to get any of the script fragments I find to work in my favor. Here is part of the JS script I currently have set up:
var z : Transform;
function OnTriggerEnter(hit : Collider){
Instantiate(z, Vector3(3032.3,2781.8,3068.6),Quaternion.identity);
z = gameObject.AddComponent("yesz");
}
The instantiation of the object z works out just fine, but the script “yesz” never gets attached to it. Could someone tell me what I should do? Thank you.