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
Share
Go down
Member [Lv. 3]
Member [Lv. 3]
Posts : 15
Points : 1669
Rep : 0
Join date : 2014-01-22
View user profile

Code error? HELP

on Thu Jan 30, 2014 2:11 pm
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;
 }
}

avatar
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 51
Points : 1729
Rep : 3
Join date : 2014-01-02
Age : 19
View user profilehttp://radioactive-studios.blogspot.com

Re: Code error? HELP

on Thu Jan 30, 2014 7:58 pm
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.
Member [Lv. 3]
Member [Lv. 3]
Posts : 15
Points : 1669
Rep : 0
Join date : 2014-01-22
View user profile

Re: Code error? HELP

on Fri Jan 31, 2014 12:33 am
(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?
Back to top
Permissions in this forum:
You cannot reply to topics in this forum