Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

Help with a simple shooter

$
0
0
Hello Guys, Apologies if this appears to be a repeated question, but I am using this code and I cannot get the addforce to work on the bullets. Im 100% sure they have a rigid body and I've toggled 'Is Kinematic' on and off to no avail. Here is the code. var Bullet : Transform; var bulletSpeed = 500; function Update () { if(Input.GetButtonDown("Fire1")) { Instantiate(Bullet,transform.position + (transform.forward * 2),transform.rotation); Bullet.rigidbody.AddForce(transform.forward * bulletSpeed,ForceMode.Impulse); } } edit: the issue is that the bullets are stacking and not moving.

Viewing all articles
Browse latest Browse all 1264

Latest Images

Trending Articles



Latest Images