gameObject not a member of UnityEngine.RaycastHit??

I keep getting this error..

'gameObject' is not a member of 'UnityEngine.RaycastHit'.

Here is my code..

import UnityEngine

import System.Collections

class door(MonoBehaviour): rayCastLength = 5 def Update(): hit as RaycastHit

    if Physics.Raycast(transform.position, transform.forward, hit, rayCastLength):
        if (hit.collider.gameObject.tag == ("door")):

Anyone have any answers. BTW, I'm following the VTC Game Development with Unity DVD


RaycastHit doesn't have a gameObject property, only collider and transform - use hit.collider.gameObject.animation like you do the line above it, or hit.transform.animation