I just got this book and i’m in chaper 1 but i cant get the script to work
here’s what i scripted:
#pragma strict
var initPos : Vector3;
var movePos : float = 0.1;
var Platform : Transform = null;
var isPressed : boolean = false;
function Start () {
initPos = transform.localPosition;
}
function MoveButton(){
if(!isPressed){
Platform.GetComponent ( platform ).Activated();
----------------------------^ what's this???
transform.position.z = transform.position.z - movePos;
isPressed = true;
Hit.gameObject.GetComponent("Button").MoveButton();
--^ what's this???
}
}
function OnControllerColliderHit (Hit :ControllerColliderHit){
if (Hit.gameObject.name == "Button"){
}
}
function Update () {
}
Here’s the errors that occur
Assets/History/Chapter 1/custom_scripts/Button.js(17,3): BCE0005: Unknown identifier: ‘Hit’.
Assets/History/Chapter 1/custom_scripts/Button.js(14,33): BCE0005: Unknown identifier: ‘platform’.
what have i done wrong