- Home /
my script wont work, even though everytthing is in the right place and 0 errors?
here it is (javascript)
//Shooting var bullitPrefab:Transform;
function update (){ if(Input.GetButtonDown("Fire1")) { var bullit = Instantiate(bullitPrefab, GameObject.Find("Cylinder0").transform.position, Quaternion.identity); bullit.rigidbody.AddForce(transform.forward * 2000); }
}
and i dont get any errors and everything is named correctly it just doesnt seem to work.
sorry it didnt come out right it looked fine before i posted it :( i dont know how to add code samples
You select the text you want to make code, and click the button with 0s and 1s on
update -> Update GetButtonDown is when button is being pressed, better to make GetButton.
Answer by Tetrad · Jun 28, 2010 at 07:15 PM
Just looking at your code I'm going to guess that you need to change the name of the function to Update
from update
.
Your answer
![](https://koobas.hobune.stream/wayback/20220613063335im_/https://answers.unity.com/themes/thub/images/avi.jpg)