Not sure what is happening, here's my script. Happen on "float dist" line.
#pragma strict
var item : GameObject;
function Start ()
{
gameObject.transform.localRotation = Quaternion.Euler(0,0,0);
}
function Update()
{
if(Input.GetKeyDown(KeyCode.E))
{
float dist = Vector3.Dist(object.positon,player.position);
if(dist
↧