strange script error

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
    void Update() {
        RaycastHit hit;
        if (Physics.Raycast(transform.position, -Vector3.up, ref hit, 100.0F))
            float distanceToGround = hit.distance;
        
    }
}

copied from examples

Use of unassigned local variable `hit'

I just dont get it :open_mouth:

Can anyone help with that?

“hit” has to be out, not ref.

–Eric

thank you