This is my error :Argument 1: cannot convert from ‘int’ to ‘string’ [Assembly-CSharp]
And this is my code :
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();
}
private void Update() {
if (Input.GetButtonDown(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)));
}
}