fix nullPointer in autotarget when a child dies

This commit is contained in:
jparent 2015-08-23 14:41:04 -04:00
parent 05ef9a9108
commit 324cd76946

View File

@ -55,7 +55,9 @@ public class AutoTarget : MonoBehaviour
foreach (Transform t in targets)
{
{
if (t == null) continue;
Vector3 targetDirection = t.transform.position - transform.position;
float realAngle = Mathf.Atan2(targetDirection.z, targetDirection.x) * Mathf.Rad2Deg;