Having some trouble converting to C#
here is the JS:
if(Input.GetKey(KeyCode.LeftShift)){
if(bulletCounter > fireRate){
var bulletPrefab = Instantiate(currentBullet, transform.position + Vector3(bulletPos,-0.25,0.01), Quaternion.Euler(0,180,0));
if(direction == true){
bulletPrefab.transform.rigidbody.velocity.x = bulletSpeed;
...
}
The problem is instantiating the prefab object. I’ve set it as a GameObject variable,
public GameObject bulletPrefab;
but this isn’t working…