Unity 5 API Updater Keeps Failing

I’ve run into a pretty big problem with Unity 5’s API changes.

After upgrading, I was presented with 156 errors from deprecated properties. Every time I tried to run the API updater, it failed and told me to check previous console messages. All the previous messages ever stated was that certain errors were preventing the updater from working, but gave no further information. After fixing some errors, the updater was still failing but was no longer giving any “previous” messages.

I ended up just fixing all 156 errors myself. However, I must be using a colossal amount of these deprecated properties in my project, because after fixing the last of the 156 errors, I was then presented with 537 more.

The updater is still failing, and there are still no previous console messages.

Okay, I really don’t want to manually fix 537 errors if I don’t have to, especially if there might be even more revealed afterwards. All of the errors are “UnityUpgradable”, yet the updater hasn’t been able to fix a single one. So far with Unity 5, the API updater has been completely useless, as I’ve had to fix every single one of these errors myself.

Does anyone know what might be causing this? Is there anything I could possibly check?

I’m sorry I can’t provide any more information. I can only provide as much as Unity gives me, and so far it hasn’t really given me anything.

You shouldn’t need to change each reference individually. Just define:

private AudioSource audio;
private Camera camera;
etc.

void Awake () {
    audio = GetComponent<AudioSource>();
    camera = GetComponent<Camera>();
    etc.
}

Once at the top of each of your scripts. All previous references to audio.Something() and camera.Whatever() in the rest of the code should then not need any additional changes - they’ll just access the cached references declared here.

Hi, I am very new with Unity and maybe this is not the place for this question but please help me.

I´ve watched 50+ hours of videos about Unity, the 3 beginners tutorials, all the scripting, UI, and 2D topics and some Yt videos with more tutorials, all before even touching the program in order to learn first and practice later.

Now I am trying the Project: Roll-a-Ball and on the very first script the program tells me:

Some scripts have compilation errors which may prevent obsolete API usages to get updated. Obsolete API updating will continue automatically after these errors get fixed.

This is the code that Unity corrected for me:

void FixedUpdate ()
{
	float moveHorizontal = Input.GetAxis ("Horizontal");
	float moveVertical = Input.GetAxis ("Vertical");

	Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

	GetComponent<Rigidbody>().AddForce (Vector3);
}

}

The line on GetComponent was changed as you can see from the script on the video 03.Moving the player, I can see that there are some changes, all the videos are for 4.6, can you please tell me what to do? I really, really want to learn Unity, but this is very confusing to me.

Thanks:

David

getcomponent() that’s the thing that links the rigidbody component to the script. your building a character controller just by looking at that. it seems everything is unable to update there api with the api updater, it seems like a big problem that unity needs to fix as soon as possible. iv’e experienced the problem more than once and i tried fixing the errors and every time i it got more problems. it looks like the problem is that you can’t fix it, that’s why the api updater fails. it might have something to do with unity and how all of the scripts are ment to be able to work with il. here is the most recent script problem i have

if(Input.GetKeyUp(KeyCode.KeypadEnter)&a­mp;&!Climbing){

the hole script

#pragma strict
//do we want the character to climb or not
var Climbing:boolean;
//the speed we want the character to travel at
public var speed:float = 5.0;
//the character who is climbing this ladder
public var target : Transform;

function OnTriggerStay(other:Collider){
//gets the person who touches the ladder
//if the personhits enter start the climbing
//if we are climbing stop climbing
if(Input.GetKeyUp(KeyCode.KeypadEnter)&a­mp;&!Climbing){
target=other.transform;
Climbing=true;
return;
// any code you need to turn back on control of your playercontroller gos here
// this by default is setup for the character motor
// its turn the control,gravity and the stepoffset on
}else if(Input.GetKeyUp(KeyCode.KeypadEnter)&a­mp;&Climbing){
Climbing=false;
target.GetComponent(CharacterMotor).canC­ontrol=true;
target.GetComponent(CharacterMotor).move­ment.gravity=20;
target.GetComponent(CharacterController)­.stepOffset=0.4;
target=null;
}
// any code you need to turn off control of your playercontroller gos here
// this by default is setup for the character motor
// its turn the control,gravity and the stepoffset off
if(Climbing){
target.GetComponent(CharacterMotor).canC­ontrol=false;
target.GetComponent(CharacterMotor).move­ment.gravity=0;
target.GetComponent(CharacterController)­.stepOffset=0;
//locks the players x,z axis to the ladders since we only need to move on the y axis
target.position.x=transform.position.x;
target.position.z=transform.position.z;
//this allows the player to move up and down the ladder
if(Input.GetKey(KeyCode.UpArrow)){
target.Translate(Vector3.up * Time.deltaTimespeed);
}else if(Input.GetKey(KeyCode.DownArrow)){
target.Translate(Vector3.down * Time.deltaTime
speed, Space.World);
}
}
}

// any code you need to turn back on control of your playercontroller should go here
// this by default is setup for the character motor
// it turn the control,gravity and the stepoffset on
// also pushes the character forward so in case the character is on top of the ladder
function OnTriggerExit(other:Collider){
if(target){

target.GetComponent(CharacterMotor).canC­ontrol=true;
target.GetComponent(CharacterMotor).move­ment.gravity=20;
target.GetComponent(CharacterController)­.stepOffset=0.4;
target.Translate(Vector3.forward * Time.deltaTime*20);
Climbing=false;
target=null;
}
}

STOPPER

#pragma strict
//the person on the ladder
private var target:Transform;

function OnTriggerStay(other:Collider) {
//the person this touching is on the ladder
//if the person hits the down key this moves them up counteracting the ladder moving them down
target=other.transform;
if(Input.GetKey(KeyCode.DownArrow)){
target.Translate(Vector3.up * Time.deltaTime*5, Space.World);
}
}

function OnTriggerEnter(other:Collider) {
//the person this touching is on the ladder
//if the person hits the down key this moves them up counteracting the ladder moving them down
target=other.transform;
if(Input.GetKey(KeyCode.DownArrow)){
target.Translate(Vector3.up * Time.deltaTime*5, Space.World);
}
}

//gets rid of the target if they are not touching the ladder
function OnTriggerExit(other:Collider) {
target=null;
}

this is the error message

Assets/project assets/scripts/LadderClimbing.js(16,41): BCE0044: unexpected char: 0xAD.