Hello,
I am Trying to make a basic shooting script for a cannonball to shoot forward but get an error message saying "missing an assembly reference"
public class Shoot : MonoBehaviour
{
public GameObject Cannonball;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetButtonDown("Fire1"))
{
Instantiate(Cannonball, transform.position, transform.rotation);
Cannonball.Velocity = transform.TransformDirection(new Vector3(0, 0, 5f));
}
}
},Hello,
I am trying to make a basic shooting script for the cannonball to fire forward but have an error message saying missing assembly Reference.
{
public GameObject Cannonball;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetButtonDown("Fire1"))
{
Instantiate(Cannonball, transform.position, transform.rotation);
Cannonball.Velocity = transform.TransformDirection(new Vector3(0, 0, 5f));
}
}
}
↧