Hello! I am receiving an error with my script. Any tips?
Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AIBullet : MonoBehaviour {
public GameObject referenceToBulletPrefab;
public float timeToWaitBetweenShots;
void Start(){
InvokeRepeating("ShootBullet", timeToWaitBetweenShots, timeToWaitBetweenShots);
}
void ShootBullet(){
Vector3 positionToShootFrom = new Vector3 (transform.position + transform.forward*1f);
Instantiate(referenceToBulletPrefab, positionToShootFrom, Quaternion.Euler(Vector3.zero));
}
// Update is called once per frame
void Update () {
}
}
ERROR:
Assets/AIBullet.cs(14,34): error CS1729: The type `UnityEngine.Vector3' does not contain a constructor that takes `1' arguments
↧