Development Problem in Unity 3D

3

I'm designing a game project in Unity 5-64bits, I'm in the making part of the camera move. When I was typing the Javascript code, trying to use parentheses always gave the following error:

  

An error has occurred - error in text editor extension chair

Inoticedtheerrorandcontinuedtofinishthecode,IarrivedatapointthatIcouldalreadyexecute,butdraggingthecodetothelocationofthefollowingmessage:

  

PleaseFixcompileerrorsbeforecreatingnewscriptcomponents

Mycode:

#pragmastrictvarVelocidade:Vector3;functionStart(){}functionUpdate(){Velocidade.x=0;Velocidade.y=0;Velocidade.z=0;if(Input.mousePosition.x<=5||Input.mousePosition.x>=screen.width-5){Velocidade.x=Input.GetAxis("Mouse X")*10*Time.deltaTime;
   }

   if (Input.mousePosition.y<=5 || input.mousePosition.y>=screen.height-5)
   {
      Velocidade.z = Input.GetAxis("Mouse X")*10*Time.deltaTime;
   }

   transform.Translate(Velocidade);
}

And clicking Play displays the following message:

  

All compiler errors have to be fixed before you can enter playmode!

I think it's because of the problems ...

    
asked by anonymous 30.03.2015 / 07:06

2 answers

3

I found the error! I believe because it is some update of unity, that does not execute the unfinished code, or because I have written the wrong code. when I conclude it performed perfectly.

Code completed.

#pragma strict

var Velocidade: Vector3;

var ConstanteZ: float;

var ConstanteX: float;

function Start () {

}

function Update () {



if (Input.mousePosition.x<=5 || Input.mousePosition.x>=Screen.width-5)
 {
   if (Input.GetAxis("Mouse X")!=0)
   {
   if (Input.GetAxis("Mouse X")>0 && Input.mousePosition.x>=Screen.width-5)
   {
    ConstanteX=2;
   } 
   else
   {
    if (Input.mousePosition.x<=5)
    {
      ConstanteX=-2;
     }
   }
  
    
    
    Velocidade.x = ConstanteX*30*Time.deltaTime;
   }
 }
 else
 {
 Velocidade.x=0;
 }

if (Input.mousePosition.y<=5 || Input.mousePosition.y>=Screen.height-5)
 {
  if (Input.GetAxis("Mouse Y")!=0)
   {
    if (Input.GetAxis("Mouse Y")>0 && Input.mousePosition.y>=Screen.height-5)
   {
    ConstanteZ=2;
   } 
   else
   {
    if (Input.mousePosition.y<=5)
    {
      ConstanteZ=-2;
     }
   }
  }
    Velocidade.z = ConstanteZ*30*Time.deltaTime;
   
 }
 else
 {
 Velocidade.z=0;
 }
 Velocidade.y = -Input.GetAxis("Mouse ScrollWheel")*200*Time.deltaTime ;
transform.Translate(Velocidade);
}
    
30.03.2015 / 17:12
1

It looks like you have this problem: "Error in text editor extension chain." when trying to edit new UnityScript file

In short, the configuration of the Boo extension (add-in) is corrupted.

I can not confirm at the moment the steps suggested in the link. So I can not say exactly what you should delete.

Possibly Disabling Boo in Add-in Manager in the Language Bindings section. Closing Unity and MonoDevelop, and reopening Unity, is enough.

    
30.03.2015 / 07:39