[SOLVED] error: BCE0044: unexpected char: 0xFFFD

Hi I’m error BCE0044: unexpected char: 0xFFFD.

I’m new around here, I flew in on The Unity 3 Beta.

I’m a brand new error from nowhere. But enough of me talking about me, why don’t you talk about me for a bit?

This line

var objBehaviour:behaviour=hit.transform.GetComponent(typeof(behaviour));

line 32

private var mainCamera: Camera;
var raycastDistanceNPC=5.0;
var raycastDistanceLoot=5.0;
var HitMaskNPC: LayerMask;
var HitMaskLoot: LayerMask;

function Start(){
	yield;
	mainCamera=GetComponent(typeof(Camera));
}

//This script raycasts out from the playerview upon clicking on the screen.
//It then sends a message out to the object touched, and says to that object, "DoStuff()"
//The DoStuff function has a string Variable which can be set to activate whatever other behaviour exists on that entity, 
//on another script on that object. Neat huh? :-)

function Update(){
	
		for (var i = 0; i < iPhoneInput.touchCount; ++i) {
        if (iPhoneInput.GetTouch(i).phase == iPhoneTouchPhase.Began) {
        	//print ("test");
			var touch = iPhoneInput.GetTouch(0); 
			var hit : RaycastHit; 
		
		if (Physics.Raycast(mainCamera.ScreenPointToRay(touch.position),hit, raycastDistanceNPC, HitMaskNPC)) {
			
			
//	if (Physics.Raycast (transform.position, Vector3.forward, Mathf.Infinity, layer))
 //   print ("The ray hit the player"); 
			
		print(hit.transform.name);
   			var objBehaviour:behaviour=hit.transform.GetComponent(typeof(behaviour));
   		
   		if(objBehaviour)
   			{
   				print(hit.transform.name + "test");
   			objBehaviour.DoStuff();
   			return;
   			}else
   			return; 
 			}
 			else if (Physics.Raycast(mainCamera.ScreenPointToRay(touch.position),  hit, raycastDistanceLoot, HitMaskLoot)) {
			
			
//	if (Physics.Raycast (transform.position, Vector3.forward, Mathf.Infinity, layer))
 //   print ("The ray hit the player"); 
			
			   	print(hit.transform.name);
   	
   			var objBehaviour2:behaviour=hit.transform.GetComponent(behaviour);
   		
   		if(objBehaviour2)
   			{
   				print(hit.transform.name + "test");
   			objBehaviour2.DoStuff();
   			return;
   			}else
   			return; 
 			}
 			
 			print ("Raycast hit nothing");
		}return;
	}return;
}

Thanks for any tips
AC

Try deleting that line and see if that fixes the compiler error. If it does, retype it in your text editor…sounds like some manner of odd unicode encoding (which can happen from copy/paste examples).

1 Like

I deleted almost every whist space in the script so the code was one contiuous line and eventually killed it off.

Thanks for the advices here tho, good to know

AaronC

Just helped me too. Thank you.

1 Like

If problem persist then…
Just copy paste code in Microsoft Word and recopy paste it in Mono Develop ! Enjoy :slight_smile:

1 Like

1−r2 … i have the error because 1−r2 is not the same as 1-r2 :smile: