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 ![]()
Can anyone help with that?