in the first script script i have a variable called zForce
var zForce : float = 0;
function Update () {
zForce = Mathf.Clamp(zForce, 0, 1000);
if(Input.GetButtonUp("Jump"))
if(!gameObject.rigidbody){
gameObject.AddComponent(Rigidbody);
rigidbody.AddForce(Vector3(0,0,zForce));
}
if(Input.GetKeyUp("up")){
zForce += 100;
}else{
if(Input.GetKeyUp("down")){
zForce -= 100;
}
}
}
and in this script i am trying to make the guitext element which the script below is attached to change depending on what zForce is, this is what i have
var push: pushBall = GetComponent(pushBall);
function Update ()
{
guiText.text = push.zForce();
}
it comes up with the error
BCE0077: It is not possible to invoke an expression of type ‘float’