Search Unity

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

Discussion in 'iOS and tvOS' started by AaronC, Jul 9, 2010.

  1. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    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

    Code (csharp):
    1.  
    2. var objBehaviour:behaviour=hit.transform.GetComponent(typeof(behaviour));
    line 32

    Code (csharp):
    1. private var mainCamera: Camera;
    2. var raycastDistanceNPC=5.0;
    3. var raycastDistanceLoot=5.0;
    4. var HitMaskNPC: LayerMask;
    5. var HitMaskLoot: LayerMask;
    6.  
    7. function Start(){
    8.     yield;
    9.     mainCamera=GetComponent(typeof(Camera));
    10. }
    11.  
    12. //This script raycasts out from the playerview upon clicking on the screen.
    13. //It then sends a message out to the object touched, and says to that object, "DoStuff()"
    14. //The DoStuff function has a string Variable which can be set to activate whatever other behaviour exists on that entity,
    15. //on another script on that object. Neat huh? :-)
    16.  
    17. function Update(){
    18.    
    19.         for (var i = 0; i < iPhoneInput.touchCount; ++i) {
    20.         if (iPhoneInput.GetTouch(i).phase == iPhoneTouchPhase.Began) {
    21.             //print ("test");
    22.             var touch = iPhoneInput.GetTouch(0);
    23.             var hit : RaycastHit;
    24.        
    25.         if (Physics.Raycast(mainCamera.ScreenPointToRay(touch.position),hit, raycastDistanceNPC, HitMaskNPC)) {
    26.            
    27.            
    28. //  if (Physics.Raycast (transform.position, Vector3.forward, Mathf.Infinity, layer))
    29.  //   print ("The ray hit the player");
    30.            
    31.         print(hit.transform.name);
    32.                var objBehaviour:behaviour=hit.transform.GetComponent(typeof(behaviour));
    33.           
    34.            if(objBehaviour)
    35.                {
    36.                    print(hit.transform.name + "test");
    37.                objBehaviour.DoStuff();
    38.                return;
    39.                }else
    40.                return;
    41.             }
    42.             else if (Physics.Raycast(mainCamera.ScreenPointToRay(touch.position),  hit, raycastDistanceLoot, HitMaskLoot)) {
    43.            
    44.            
    45. //  if (Physics.Raycast (transform.position, Vector3.forward, Mathf.Infinity, layer))
    46.  //   print ("The ray hit the player");
    47.            
    48.                    print(hit.transform.name);
    49.       
    50.                var objBehaviour2:behaviour=hit.transform.GetComponent(behaviour);
    51.           
    52.            if(objBehaviour2)
    53.                {
    54.                    print(hit.transform.name + "test");
    55.                objBehaviour2.DoStuff();
    56.                return;
    57.                }else
    58.                return;
    59.             }
    60.            
    61.             print ("Raycast hit nothing");
    62.         }return;
    63.     }return;
    64. }
    Thanks for any tips
    AC
     
  2. BoredKoi

    BoredKoi

    Joined:
    Jun 18, 2009
    Posts:
    162
    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).
     
    Kasia_Wieciorek likes this.
  3. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    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
     
  4. Goody!

    Goody!

    Joined:
    Sep 11, 2009
    Posts:
    100
    Just helped me too. Thank you.
     
    dapa5678 likes this.
  5. sandeepjiya

    sandeepjiya

    Joined:
    Jul 2, 2014
    Posts:
    1
    If problem persist then...
    Just copy paste code in Microsoft Word and recopy paste it in Mono Develop ! Enjoy :)
     
    dapa5678 likes this.
  6. mezzostatic

    mezzostatic

    Joined:
    Aug 18, 2016
    Posts:
    13
    1−r2 ... i have the error because 1−r2 is not the same as 1-r2 :D