FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionCode error? HELP

more_horiz
WHERE IS THE ERROR IN THIS? IM BIGGINER I DONT REALLY GET IT! this is what unity cosnole says:

1) Assets/Standard Assets/Character Controllers/Sources/Scripts/PlatformMove.js(20,41): BCE0044: expecting ), found '='.
2)Assets/Standard Assets/Character Controllers/Sources/Scripts/PlatformMove.js(20,59): BCE0043: Unexpected token: ).




Code:

#pragma strict

private var Xpos : float ;
private var Ypos : float ;
private var Max  : boolean ;

var Vert : boolean ;
var MaxAmount : int ;
var Step : float ;

function Start () {
 Xpos = transform.position.x;
 Ypos = transform.position.y;
}

function Update () {
      if(Vert){ //Vertical
        if(transform.position.y >= Ypos + maxAmount) {
            max = true;
        } else if(transform.position.y = Xpos + maxAmount)
            max = true;
        } else if(transform.position.x <= Xpos){
          max = false;
        }
 }
//MOVING THE PLATFORM
if(Vert){ // Vertical movement
  if(!max){
    transform.position.y += step;
  } else {
    transform.position.y -= step;
  }
} else { //Horizontal movement
  if(!max){
    transform.position.x += step;
 } else {
      transform.position.x -= step;
 }
}

descriptionRe: Code error? HELP

more_horiz
try reimporting your character controller. the script for the platform movement is messed up. i am learning scripting as we speak but i read the error and it looks like it is missing. hope it works bro.

descriptionRe: Code error? HELP

more_horiz
@(swag)quickscoper wrote:
try reimporting your character controller. the script for the platform movement is messed up. i am learning scripting as we speak but i read the error and it looks like it is missing. hope it works bro.


this script has nothing to do with character controller.. as you see the script is for platform movemed... the movement of some cubes horizontally or vertically... did you found the errors?
Permissions in this forum:
You cannot reply to topics in this forum