BCE0044: unexpected char : 0xD Please help.

What is this weirdass error supposed to mean?

BCE0044: unexpected char : 0xD

#pragma strict

var rotationSpeed = 200;
var jumpHeight = 8;
var speed : float = 0.2;
var TurnSpeed = 2.

private var isFalling = false;

function Start() {}

function Update ()
{
//Handle ball rotation

if ( Input.GetKey(“w”) )

this.transform.position += this.transform.forward * this.speed;

if ( Input.Getkey(“s”) )

this.transform.position -= this.transform.forward * this.speed;

var rotation : float = Input.GetAxis (“Horizontal”) * rotationSpeed;
rotation *= Time.deltaTime;
GetComponent.().AddRelativeTorque(Vector3.back * rotation);

//Handle ball jump
if (Input.GetKeyDown(KeyCode.Space) && isFalling == false)
{
GetComponent.().velocity.y = jumpHeight;
isFalling = true;
}
}

function OnCollisionEnter ()
{
isFalling = false;
}

please use code tags when you paste code into the forums, helps with the readability, there is a sticky at the top of the scripting forum on them. Errors tend to have line numbers, what line is it complaining about?

0xD is hex for carriage return. On Windows machines, this is the first half of a two character control for starting a new line. This character, along with it’s counter part ‘new line’ (0XA), are invisible.

My only guess is that you copied your script from somewhere and it has too many of these characters in it. If you were to type in the code it would probably work… You could also try copy pasting it into a simple text editor to see if it fixes the line returns for your system.

UnityScript doesn’t have a super robust parser so these kinds of weird things can crop up… Just another reason to switch to C#…

1 Like

Okey im really sorry, im kind off new with this forum and Unity.

That worked thanks!

Looks like the turnspeed declaration didn’t have a semi colon at the end. That may have been part of the issue as well

don’t worry, we keep the “ninja unity forum doughnut death squad of doom” visits to the second offence :stuck_out_tongue:

Is that the Unity Team that the stealth tutorial is based on?

1 Like