- Home /
Assets/Standard Assets/Scripts/General Scripts/follow.js(9,59): BCE0044:unexpected char: 0xAD
can someone help me I keep getting Assets/Standard Assets/Scripts/General Scripts/follow.js(9,59): BCE0044:unexpected char: 0xAD error message and I've tried every thing to fix it I can think of. This is what i have:
var target : Transform; var moveSpeed = 3; var rotationSpeed = 3; var myTransform : Transform;
function Awake(){ myTransform = transform; }
function Start(){ target = GameObject.FindWithTag("Player";).transform; }
function Update () myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime); myTransform.position += myTransform.forward moveSpeed Time.deltaTime; }
Answer by Graham-Dunnett · Oct 01, 2014 at 09:24 PM
If you google for 0xAD you'll come across other posts on Answers with the same problem. The 4th google hit tells you that character 0xAD is a soft-hyphen. That indicates that the minus sign in your code is not a minus character, but a soft hyphen instead. The compiler isn't expecting to find a soft hyphen. If you select it, and replace it with a - character - that's a hyphen-minus, ascii char 45.
Your answer
Follow this Question
Related Questions
problem at adding script 1 Answer
Need Help Understanding Script! (Javascript) 1 Answer
Unknown identifier "If" (Javascript) 2 Answers
Scripting error! 1 Answer
Stomp Script 1 Answer