hi
i created this code:
using UnityEngine;
using System.Collections;
public class Shooting : MonoBehaviour
{
public Rigidbody Bullet;
public float bulletSpeed = 100;
public Transform Spawn;
void Update()
{
if(Input.GetButtonDown("Fire1"))
Debug.Log("HI");
{
Rigidbody newBullet = Instantiate(Bullet ,Spawn.position,Spawn.rotation)as Rigidbody;
newBullet.velocity = transform.TransformDirection(new Vector3(0,0, bulletSpeed));
}
}
}
and and he dont see the “if” he just create more and more bullets
and dont wait till i click on the fire1,he even dont write the log just create more and more
what sould i do?
thx;)