'rigidbody' is not a member of 'UnityEngine.Object"

When I build my game for the iphone this comes up: 'rigidbody' is not a member of 'UnityEngine.Object"

here is my code... Anyone have an answer?

var bullet  = Instantiate(BulletPrefab, GameObject.Find("SpawnBullet").transform.position, Quaternion.identity);
bullet.rigidbody.AddForce(transform.forward * 1000);

1 Answer

1

Give your bullet a type. It is currently coming out as a base Object.

var bullet : Transform