mirror of
https://github.com/ConjureETS/PillowFight.git
synced 2026-03-24 00:50:59 +00:00
fix nullPointer in autotarget when a child dies
This commit is contained in:
parent
05ef9a9108
commit
324cd76946
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user