Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » HELP » Help (General) » Code error? HELP

Code error? HELP

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Code error? HELP on Thu Jan 30, 2014 2:11 pm

georgeziozas


Member [Lv. 3]
Member [Lv. 3]
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;
 }
}

View user profile

2 Re: Code error? HELP on Thu Jan 30, 2014 7:58 pm

(swag)quickscoper


{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
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.

View user profile http://radioactive-studios.blogspot.com

3 Re: Code error? HELP on Fri Jan 31, 2014 12:33 am

georgeziozas


Member [Lv. 3]
Member [Lv. 3]
(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?

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum