Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Very strange error when building

Discussion in 'Editor & General Support' started by rahulsanjay18, May 23, 2020.

  1. rahulsanjay18

    rahulsanjay18

    Joined:
    Jul 4, 2016
    Posts:
    6
    I was working on a tutorial, and while I was working on it, running the build on Unity was going fine. When I wanted to export my build for WebGL, I started getting these errors that haven't occured before. When I switched back to the regular PC build settings, these errors persisted.

    upload_2020-5-23_17-10-8.png

    I have never used Rider and I don't know what it is (I think it's an editor but i dont know). My editor that I use is Notepad++. I haven't ever encountered these errors, while doing normal development.
     
  2. Open up the package manager, select the "packages in project", look for the "JetBrains Rider Editor", uninstall it, and see if the problem goes away.
    Although I think, there is something else in this case, because your timeline also reports some problems. Anyway, remove the Rider and if you still have errors, come back and give more info, like what editor, what versions of things and full error messages.
     
  3. rahulsanjay18

    rahulsanjay18

    Joined:
    Jul 4, 2016
    Posts:
    6
    The error for the timeline thing is:
    Library\PackageCache\com.unity.timeline@1.2.14\Editor\Window\TimelineWindow_Manipulators.cs(11,18): error CS0246: The type or namespace name 'RectangleZoom' could not be found (are you missing a using directive or an assembly reference?)

    I googled it and it may have to do with camera controlling I did but I'm not sure what it is. Here is the script for the camera I use (i got most of it from a github thing but edited it somewhat for my purposes):


    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4. public class FlyCamera : MonoBehaviour {
    5.     /*
    6.     Writen by Windexglow 11-13-10.  Use it, edit it, steal it I don't care.
    7.     Converted to C# 27-02-13 - no credit wanted.
    8.     Simple flycam I made, since I couldn't find any others made public.
    9.     Made simple to use (drag and drop, done) for regular keyboard layout
    10.     wasd : basic movement
    11.     shift : Makes camera accelerate
    12.     space : Moves camera on X and Z axis only.  So camera doesn't gain any height*/
    13.    
    14.    
    15.     public float mainSpeed = 10f; //regular speed
    16.     public float shiftAdd = 10f; //multiplied by how long shift is held.  Basically running
    17.     public float maxShift = 100f; //Maximum speed when holdin gshift
    18.     public float camSens = 0.25f; //How sensitive it with mouse
    19.     public bool is_active = false;
    20.     public GameObject enable_button = null;
    21.     private Vector3 lastMouse = new Vector3(255, 255, 255); //kind of in the middle of the screen, rather than at the top (play)
    22.     private float totalRun= 1.0f;
    23.    
    24.    
    25.     void Update () {
    26.         if(is_active){
    27.             lastMouse = Input.mousePosition - lastMouse ;
    28.             lastMouse = new Vector3(-lastMouse.y * camSens, lastMouse.x * camSens, 0 );
    29.             lastMouse = new Vector3(transform.eulerAngles.x + lastMouse.x , transform.eulerAngles.y + lastMouse.y, 0);
    30.             transform.eulerAngles = lastMouse;
    31.             lastMouse =  Input.mousePosition;
    32.             //Mouse  camera angle done.
    33.      
    34.             //Keyboard commands
    35.             //float f = 0.0f;
    36.             Vector3 p = GetBaseInput();
    37.             if (Input.GetKey (KeyCode.LeftShift)){
    38.                 totalRun += Time.deltaTime;
    39.                 p  = p * totalRun * shiftAdd;
    40.                 p.x = Mathf.Clamp(p.x, -maxShift, maxShift);
    41.                 p.y = Mathf.Clamp(p.y, -maxShift, maxShift);
    42.                 p.z = Mathf.Clamp(p.z, -maxShift, maxShift);
    43.             }else{
    44.                 totalRun = Mathf.Clamp(totalRun * 0.5f, 1f, 1000f);
    45.                 p = p * mainSpeed;
    46.             }
    47.      
    48.             p = p * Time.deltaTime;
    49.             Vector3 newPosition = transform.position;
    50.             if (Input.GetKey(KeyCode.Space)){ //If player wants to move on X and Z axis only
    51.                 transform.Translate(p);
    52.                 newPosition.x = transform.position.x;
    53.                 newPosition.z = transform.position.z;
    54.                 transform.position = newPosition;
    55.             }else{
    56.                 transform.Translate(p);
    57.             }
    58.         }
    59.        
    60.         if(Input.GetKey(KeyCode.Escape)){
    61.             is_active = false;
    62.             enable_button.SetActive(true);
    63.         }
    64.         if(is_active && enable_button.activeSelf){
    65.             lastMouse = Input.mousePosition;
    66.             enable_button.SetActive(false);
    67.         }
    68.     }
    69.    
    70.     private Vector3 GetBaseInput() { //returns the basic values, if it's 0 than it's not active.
    71.         Vector3 p_Velocity = new Vector3();
    72.         if (Input.GetKey (KeyCode.W)){
    73.             p_Velocity += new Vector3(0, 0 , 1);
    74.         }
    75.         if (Input.GetKey (KeyCode.S)){
    76.             p_Velocity += new Vector3(0, 0, -1);
    77.         }
    78.         if (Input.GetKey (KeyCode.A)){
    79.             p_Velocity += new Vector3(-1, 0, 0);
    80.         }
    81.         if (Input.GetKey (KeyCode.D)){
    82.             p_Velocity += new Vector3(1, 0, 0);
    83.         }
    84.         return p_Velocity;
    85.     }
    86.    
    87. }