Unity3D problem. Bullets fall down instead of flying like they should
Posted
by
user2342080
on Game Development
See other posts from Game Development
or by user2342080
Published on 2013-07-01T00:17:01Z
Indexed on
2013/07/01
4:29 UTC
Read the original article
Hit count: 277
unity
I used this tutorial as a reference. http://www.youtube.com/watch?v=3L8eaoyZ0Go My problem is that whenever I play the game, EVERYTHING works but the bullets. It just falls down instead of flying forward.
This is the flash version of the game: http://v1k.me/swf/
Can some one help me out? Should I upload the project?
This is my "Shoot.js":
public var bulletPrefab : Transform;
public var bulletSpeed : float = 20;
function Update() {
if(Input.GetMouseButton(0)) {
if(bulletPrefab || bulletSpeed) {
var bulletCreate = Instantiate(bulletPrefab, GameObject.Find("SpawnPoint").transform.position, Quaternion.identity);
bulletCreate.rigidbody.AddForce(transform.forward * bulletSpeed);
}
}
}
© Game Development or respective owner