Hey, I am having a little trouble with instantiating.
What I started out with was attaching this script:
var newObject : GameObject;
function Update () {
if (Input.GetButtonDown("Fire1") && Position.y < 0.5) {
Instantiate(newObject, Vector3(0, -2, 0), Vector3(0, 0, 0));
}
}
To the character (3rd person). I then added the "Campfire" prefab as newObject so that if you click the mouse button, it creates a campfire below you. It gave me error messages though, and when you click the mouse, the campfire was located around the character's head and rotated 90 degrees. I need it on the ground.
Does somebody know how I can fix this script to get it to work?
Thanks!