- Home /
The question is answered, right answer was accepted
Throwing Spheres
I am following a tutorial on throwing crates or something, but I am doing it with fire balls (referred to as 'fire' in script) They appear once i press left click where I am standing, but stay in the air where i was standing and they don't move. Help? Thanks in advance, and Happy Holidays!
JavaScript:
var Speed = 3.0;
var firePrefab:Transform;
function Update(){
if(Input.GetButtonDown("Fire1")){
var fire = Instantiate(firePrefab, transform.position, Quaternion.identity);
fire.rigidbody.AddForce(transform.foward * 2000);
}
}
Even though I know this is an obvious question, did you check to make sure that the rigidbody component of your prefab is not kinematic and that it is using gravity? :)
Answer by OwenBayi · Dec 26, 2012 at 02:31 AM
Sorry for the bother, I figured it out. It was the forward problem that lemonizer mentioned, and the 'fire' was the parent of a non-rigidbody object. Thanks for the help.
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Object not moving,Object not moving in any direction 1 Answer
I need to swing the ship on 2D 1 Answer
Sphere + rigidbody + character controller 1 Answer
Movement problem? 0 Answers