I’m new to Unity and I found this error and don’t know how to fix.
using UnityEngine;
public class PlayerShoot : MonoBehaviour {
public float fireRate = 0.2f:
public Transform firingPoint;
public GameObject bulletPrefab;
float timeUntilFire;
PlayerMovement pm;
private void Start() {
pm = gameObject.GetComponent<PlayerMovement>();
}
private void Update() {
if (Inputer.GetMouseButtonDown(0) && timeUntilFire < Time.time) {
Shoot();
timeUntilFire = Time.time + fireRate;
}
}
void Shoot() {
float angle = pm.isFacingRight ? 0f : 180f;
Instantiate(bulletPrefab, firingPoint.position, Quaternion.Euler(new Vector3(0f, 0f, angle)));
}
}