Expecting }, found ".

here is the script im working on. it highlights the lats ( } ) help plz

var projectile : Rigidbody;
var damage = 5;

function Update () {

if(Input.GetButtonDown(‘Fire1’)){
Spawnpoint = transform.Find;(FirstPersonController/MainCamera/Spawnpoint);
SpawnVector = Vector3(Spawnpoint.position.x, Spawnpoint.position.y, Spawnpoint.position.z);
var clone : Rigidbody;
clone = Instantiate(projectile, SpawnVector, Spawnpoint.rotation);
clone.velocity = Spawnpoint.TransformDirection (SpawnVector.forward*20);
}

Your simply missing a } to close of your if(input.buttondown) statement in the update function.

This is an excellent example why code formatting makes sense. Put the closing bracket always aligned to the statement. That way you can easily see when there is a bracket missing.

var projectile : Rigidbody;
var damage = 5;

function Update () {

	if(Input.GetButtonDown('Fire1')){
		Spawnpoint = transform.Find;(FirstPersonController/MainCamera/Spawnpoint);
		SpawnVector = Vector3(Spawnpoint.position.x, Spawnpoint.position.y, Spawnpoint.position.z);
		var clone : Rigidbody;
		clone = Instantiate(projectile, SpawnVector, Spawnpoint.rotation);
		clone.velocity = Spawnpoint.TransformDirection (SpawnVector.forward*20);
}

thanx. i have used ur revamed script Tiles and it no shows this problem Unxpected char ‘v’ and it highlughts the (1.var projectile : Rigidbody;)

1.var projectile : Rigidbody;
2.var damage = 5;
3.
4.function Update () {
5.
6. if(Input.GetButtonDown(‘Fire1’)){
7. Spawnpoint = transform.Find;(FirstPersonController/MainCamera/Spawnpoint);
8. SpawnVector = Vector3(Spawnpoint.position.x, Spawnpoint.position.y, Spawnpoint.position.z);
9. var clone : Rigidbody;
10. clone = Instantiate(projectile, SpawnVector, Spawnpoint.rotation);
11. clone.velocity = Spawnpoint.TransformDirection (SpawnVector.forward*20);
12.}

Did you just copy and paste the code including all the numbers? O.o

Is this the first time you are coding? :wink:

Remove the numbers, format your code and have a second look.
And when posting code on the boards, please use the [plain]YOUR CODE HERE[/plain] tags which will format the code like in Tiles’ post.

oh lol. yep its my first time coding.

OKay here it is so far and still not working

var projectile : Rigidbody;
var damage = 5;
 
function Update () {
 
    if(Input.GetButtonDown('Fire1'));

        Spawnpoint = transform.Find;(FirstPersonController/MainCamera/Spawnpoint);
        SpawnVector = Vector3(Spawnpoint.position.x, Spawnpoint.position.y, Spawnpoint.position.z);
        var clone : Rigidbody;
        clone = Instantiate(projectile, SpawnVector, Spawnpoint.rotation);
        clone.velocity = Spawnpoint.TransformDirection (SpawnVector.forward*20);
}

The first answer by ben4views would have solved you problem. You are simply missing a closing brace/bracket.
I’ve aligned the code so you can see where the opening and closing brackets should be for the code to work properly.
Had to fix a few other errors there too, not sure if it will work. You should look up the unity scripting reference http://docs.unity3d.com/Documentation/ScriptReference/index.html and search for keywords like “transform.Find” etc. it will give you an example of how to use it. Also look up some basic tutorials on coding, It will be well worth your while.

var projectile : Rigidbody;
var damage = 5; 

function Update ()
    {
        if(Input.GetButtonDown('Fire1'))
            {
                var Spawnpoint = transform.Find ("FirstPersonController/MainCamera/Spawnpoint");
                var SpawnVector = Vector3(Spawnpoint.position.x, Spawnpoint.position.y, Spawnpoint.position.z);
                var clone : Rigidbody;
                clone = Instantiate(projectile, SpawnVector, Spawnpoint.rotation);
                clone.velocity = Spawnpoint.TransformDirection (SpawnVector.forward*20);
            }
    }

thanks dude. :slight_smile:

huffybrahh do your self a favor and read the ref pages and btw for the first time coding im not exactly sure if u took that code from someone else or wrote it your self doesnt look like something a first time coder would be able to write imo