var Char_Bullet : Transform;
function Update ()
{
if(Input.GetButtonDown("Fire1"))
{
var bullet - Instantiate(Char_Bullet,GameObject.Find("Gun_Spawn").transform.position,Quaternion.identity);
bullet.rigidbody_Addforce(transform.forward * 2000);
}
}
hey, im new to unity but i got the code from a video, trying to show me how to make my gun shoot.
i always get the error Assets/Standard Assets/Scripts/Shoot_Rigid_Bodys.js(6,35): UCE0001: ';' expected. Insert a semicolon at the end.
Help?
when i fire it just falls out, and i get error MissingMethodException: Method not found: 'UnityEngine.Rigidbody.Addforce'.
– anon26891799Mike - change Addforce to AddForce (capital F)
– anon93786194Ugh, slaps his keyboard. Fixed, thanks
– anon85704231