Coding Issue

Here is my script:

var ThrowStar:transform;

var bulletSpeed :float = 6000;

function Update(){
	if (Input.GetButtonDown ("Fire1")) {
		if(!ThrowStar || !bulletSpeed){ 
			Debug.Log("[Shoot] 'ThrowStar' or 'bulletSpeed' is undefined");
		}else { 
		var ThrowStar=Instantiate(ThrowStar,GameObject.Find('ThrowSpawn').transform.posistion,Quaternion.idenetity);
		ThrowStar.rigidbody.AddForc­e (Transform.forward * bulletSpeed); 
		}
	}
}

The last line is giving me issues: BCE0044: unexpected char: 0xAD. I’ve worked on this line for an hour or more, any kind of help would be great.

Thank you!

For starters, bulletSpeed when cast to a bool will always return true- there is no situation in which it can be false.

But more than that, the problem is actually on the line before the line which is causing the error. There are two problems I can see there-

You have the wrong characters inside your GameObject.Find(string) statement. Instead of a string literal, it’s something different!

It should be like

GameObject.Find("ThrowSpawn")

instead of

GameObject.Find('ThrowSpawn')

Other than that, you spelled identity wrong after Quaternion, and position wrong after transform. Check those.

There are some other issues here, but this’ll get you past the compiler, and we can get into actual functionality then.