public float speed = 5;(定义一个速度值)
给bullet添加初速度:
sphere-add component-rigidbody(可以给bullet添加速度)
if( Input.GameObject(0) )
{
GameObject b = GameObject.Instantiate( bullet, transform.position, transform.rotation);
Rigidbody rgd= b.GetComponent<Rigidbody>(); forward=(0,0,1)
rgd.velocity=transform.forward *speed;
前方向(y=0,x=0,z=1)