Unexpected char: 0xAD

Uhm… why? :frowning: Why do I get the error: Unexpected char: 0xAD (13,65)

var speed = 6.0;
var jumpSpeed = 8.0;
var gravity = 20.0;

private var moveDirection = Vector3.zero;
private var grounded : boolean = false;

function FixedUpdate() {
if (grounded) 
{
	// We are grounded, so recalculate movedirection directly from axes
	moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0); 
	moveDirection = transform.TransformDirection(moveDirecti­on);
	moveDirection *= speed; 	
	if (Input.GetButton ("Jump")) 
	{
		moveDirection.y = jumpSpeed;
	}
}

 // Apply gravity
 moveDirection.y -= gravity * Time.deltaTime;
 
// Move the controller
 var controller : CharacterController = GetComponent(CharacterController);
 var flags = controller.Move(moveDirection * Time.deltaTime);
 grounded = (flags & CollisionFlags.CollidedBelow) != 0;
}

Your line 13 is the one:

moveDirection = transform.TransformDirection(moveDirecti­on);

You’ve somehow got an invisible soft hyphen inbetween the i and o of your moveDirection at the end of the line. Just select that variable, delete it, and re-enter it using your keyboard.

Got the same problem it says (23,58) Unexpected char: 0xAD heres my script

#pragma strict


var target : Transform; 
var moveSpeed = 3; 
var rotationSpeed = 3; 
var attackThreshold = 3; 
var chaseThreshold = 10;
var giveUpThreshold = 20; 
var attackRepeatTime = 1; 
var explosionPrefab : Transform;
private var chasing = false;
private var attackTime = Time.time;
var myTransform : Transform; 

function Awake()
{
 	myTransform = transform;
}

function Start()
{
	target = GameObject.FindWithTag("Player").transfo­rm; 
}
function OnCollisionEnter(collision : Collision) 
{
	if(countenermyhits == 3){*/ Destroy (gameObject);
}

function Update () { 
	var dist = (target.position - myTransform.position).magnitude; if (chasing) {  
	
	myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime);
	
	myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime; 
	
	if (dist greaterthan giveUpThreshold) { chasing = false; } 
	
	if (dist lessthan attackThreshold && Time.time greaterthan attackTime) { 
	
	Instantiate(explosionPrefab,transform.po­sition, transform.rotation); Destroy (gameObject); attackTime = Time.time + attackRepeatTime; } } else { 
	
	if (dist lessthan chaseThreshold) { chasing = true; } }
}