Hi guys i am making a game similar to worminator. However my shooting script doesnt work in that my character doesnt even fire the bullet although movement works, can you have a look at it and see whats wrong.
var speed = 3.0;
var rotateSpeed = 3.0;
var bullitPrefab:Transform;
function Update ()
{
var controller : CharacterController = GetComponent(CharacterController);
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
var Bullet : Transform;
function (
(Input.GetButtonDown("Jump"))
{
Instantiate(Bullet,transform.position,Quaternion.identity);
Bullet.rigidbody.AddForce(transform.forward * 1000);
}
}
It doesnt seem to work :( firstly i see that it says expectin } found " on 17,1. Secondly do i need to change the word bullit prefab to my bullet and thirdly do i attach it to the actual character?