Hi im attempting to create a method for getting a random location inside an object. Im mainly doing this to make my missiles a little more interesting as when dealing with a large object [1000 units] having lots of them all heading all to the same central point doesn't look good. I think I have a good basic method down but cant seam to get it to work;

//Position Generation Used in Start()
Transform c = target.FindChild ("ColSpheres");
if (c != null) {
int i = 0;
foreach (Transform s in c) {
i++;
}
Transform[] scd = new Transform*;*
*i = 0;*
*foreach (Transform s in c) {*
_scd *= s;*_
_*i++;*_
_*}*_
_*int rands = Random.Range (0, i - 1);*_
_*Bounds b = (scd[rands].GetComponent (typeof(SphereCollider)) as SphereCollider).bounds;*_
_*targetpos = scd[rands].transform.localPosition*_
_*+ c.localPosition*_
<em>_+ Random.insideUnitSphere * b.extents.magnitude;_</em>
_*}*_
_*//Tracking Code used in Update()*_
_*Quaternion targetrotation = Quaternion.LookRotation (*_
_*(target.position*_
_*+ Vector3.Scale(target.transform.InverseTransformPoint (targetpos+target.position),*_
_*target.lossyScale)) - transform.position);*_
_*transform.rotation = Quaternion.RotateTowards (*_
_*transform.rotation, targetrotation,*_
<em>_turnspeeddeg * Time.deltaTime);_</em>
_*```*_
_*<p>I think the main problem is located in the target rotation section as I cant seam to find the right method of transforming the local position to the world position.</p>*_