using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
public GameObject Wall;
public Vector3 thePosition = transform.TransformPoint(Vector3.forward * 5);
// Update is called once per frame
void Update () {
if ( Input.GetButtonDown ("Build"))
{
Instantiate (Wall, thePosition, Wall.transform.rotation);
}
}
}
I get the error Assets/Scenes/NewBehaviourScript.cs(6,30): error CS0236: A field initializer cannot reference the nonstatic field, method, or property `UnityEngine.Component.transform' any clues?
Is this the best way to instantiate infront of player?
Off to sleep now, Ill check back in the morning (Well it is the morning but after I get up ;D)