Transform.Find works improperly

Hi,

I’ve a script, that uses this code:

Vector3 weaponRot = new Vector3(rot.eulerAngles.x, rot.eulerAngles.y, 0);
		transform.Find("Shotgun").eulerAngles = weaponRot;

There is no “Shotgun” child in this transform.

The problem is that when I run the game and it reaches the row with “transform.Find” it just stops execution of the script and doesn’t give me any exception like “Nullreference”.

Please, fix it in Unity3D 3.0 :slight_smile:

Actually, I think I might’ve run into something like this too - calling Transform.Find() would just crash if the specified child object was missing.

(It didn’t occur to me to do so at the time, but if I can reproduce it, I’ll file a bug report.)