function Update, not function update. This way, you have not declared a function that will be executed each frame, but a function that will never be executed
Update() and update() are not the same function – note the capital ‘U’.
If you use this code, the amount of time between jumps will vary depending on the game’s current FPS; that’s usually not a desired behavior. You might instead consider using FixedUpdate() or InvokeRepeating() to manage this.
As @BiG said, update isn’t the same thing as Update - you should fix the function name (it’s Update).
Anyway, all you will get with this code is a rigidbody being accelerated to the sky - 20 frames isn’t a stable and useful time interval. You could instead set the next time to jump after each jump:
var jumpInterval: float = 1.0; // interval between jumps in seconds
var power : float = 500.0;
private var timeToJump: float = 0.0;
function Update () {
if (Time.time >= timeToJump){
rigidbody.AddForce(Vector3(0,power,0));
timeToJump = Time.time+jumpInterval;
}
}