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)&&!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)&&!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)&&Climbing){
Climbing=false;
target.GetComponent(CharacterMotor).canControl=true;
target.GetComponent(CharacterMotor).movement.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).canControl=false;
target.GetComponent(CharacterMotor).movement.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.deltaTimespeed, 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).canControl=true;
target.GetComponent(CharacterMotor).movement.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.