- Home /
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.AddForce (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!
Answer by syclamoth · Nov 07, 2011 at 09:05 AM
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.
Your answer
![](https://koobas.hobune.stream/wayback/20220613033925im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unexpected symbol 'Flip' and 'else' 1 Answer
BCE0044 unexpected char: 0xFEFF 2 Answers
Semicolons are seen as an unexpected symbol 1 Answer
Please help, syntax error woe 2 Answers
Error BCE0044 plz help 0 Answers