rigidbody' is not a member of 'UnityEngine.Object

I have this script:

public var snowballPrefab : Transform; public var snowballSpeed : float = 6000;

function Update(){ if(Input.touchCount > 2) { if(!snowballPrefab || !snowballSpeed) { Debug.Log("[Shoot] 'bulletPrefab' or 'bulletSpeed' is undefined"); }else{ var snowballCreate = Instantiate(snowballPrefab, GameObject.Find("spawnPoint").transform.position, Quaternion.identity); snowballCreate.rigidbody.AddForce(transform.forward * snowballSpeed); } } }

Im using unity 3 for iphone devolopment and it works in the window, but it wont build.

i get this error: 'rigidbody' is not a member of 'UnityEngine.Object'.

what have I done wrong and how can it be fixed?

Thanks!

http://answers.unity3d.com/questions/35496/cannot-implicitly-convert-type-unityengine-object-to-unityengine-gameobject

var snowballCreate = Instantiate(snowballPrefab, GameObject.Find("spawnPoint").transform.position, Quaternion.identity) as GameObject;

Also, use #pragma strict at the top of your JS scripts, and then you won't have the not-building problem.