- Home /
I THINK that i have aplied a force of 1000 but it wont work
var simpleBulletPrefab : Transform;
function Update() { if(Input.GetButtonDown("Jump")) { Instantiate(simpleBulletPrefab, transform.position, transform.rotation);
simpleBulletPrefab.rigidbody.AddForce(transform.forward * 1000); } }
Answer by Kiloblargh · Sep 01, 2012 at 10:48 PM
var simpleBulletPrefab : GameObject;
function Update() { if (Input.GetButtonDown("Jump")) { var aBullet : GameObject = Instantiate (simpleBulletPrefab, transform.position, transform.rotation) as GameObject; aBullet.rigidbody.AddForce (transform.forward * 1000); } } //ftfy
Your answer
Follow this Question
Related Questions
Make enemy more intelligent 0 Answers
How to shoot a puck straight? (JS) 0 Answers
Shooting with a locked camera position 1 Answer
How do I make a gun? 1 Answer
Can someone help me fix my Javascript for Flickering Light? 6 Answers