Finding transform not working

I have a player all set up, with my “shoot” Script. The script looks for a transform called “spawnPoint” and instantiates the bullet from there. BUT, My player is set up so the spawnPoint is an child of the camera. If it’s set up like that, it can’t find the spawnPoint. BUT if I put the spawnPoint as a child of the “Shoot” object, it can find it. I NEED it to be a child of the camera, so can anyone figure out why this is?

Please post your code. That way i might be able to help.

Shoot Function

function Shoot(){
var bullit = Instantiate(PistolbullitPrefab ,transform.Find("spawnPoint").transform.position, transform.rotation);	
	bullit.rigidbody.AddForce(transform.forward * 25000);
	//animation.Play("Pistol_Recoil");
    var Light = GameObject.Find("SGspawnPoint");
	//Light.GetComponent("Halo").enabled = true;
	//yield WaitForSeconds(.02);
	//Light.GetComponent("Halo").enabled = false;
	PistolSounds();
}

layout of objects

I don’t think transform implements the Find() method. You might want something close this.

(Vector3)GameObject.Find("spawnPoint").transform.position
var spawnpoint : GameObject;

fucntion Start()
{
  spawnpoint = GameObject.Find("Spawn");

}

Then use spawnpoint.transform.position

Now the bullet only travels forward. It isn’t taking in the rotation of the spawnpoint…

Then get the rotation of whatever it’s supposed to match.

Maybe trouble yourself with posting your current version of the code and explaining what you hope to accomplish?