- Home /
My script accessing a variable from another script recieves an error
Camera.main.GetComponent(ColorCorrectionEffect).rampOffsetR = 100-health;
Okay so im new in unity and i am getting familiarised with it. Now i have this line in an update() function and it recieves the following error:
Assets/Standard Assets/Scripts/FPSWalker.js(155,74): BCE0044: expecting :, found '='.
here is the whole function Update() (maybe the problem is out there)
function Update () { // If the run button is set to toggle, then switch between walk/run speed. (We use Update for this... // FixedUpdate is a poor place to use GetButtonDown, since it doesn't necessarily run every frame and can miss the event) if (toggleRun && grounded && Input.GetButtonDown("Run")){ speed = (speed == walkSpeed? runSpeed : walkSpeed); } if (health<1){ audio.PlayOneShot(shadap); transform.position = respawnpoint.transform.position;
dietimes++; health=101;
} if(health<100);{ Camera.main.GetComponent(ColorCorrectionEffect).rampOffsetR = 100-health; yield WaitForSeconds(0,2); health+=1; }
}
Answer by Eric5h5 · May 27, 2010 at 09:14 PM
if(health<100);{
should be
if(health<100) {
ha wut oh i missed that thank you and i was searching for half an hour