diff --git a/Assets/Scripts/Behaviours/SpawnManager.cs b/Assets/Scripts/Behaviours/SpawnManager.cs index 3196e695..082729c0 100644 --- a/Assets/Scripts/Behaviours/SpawnManager.cs +++ b/Assets/Scripts/Behaviours/SpawnManager.cs @@ -58,11 +58,13 @@ namespace SanAndreasUnity.Behaviours public static Transform GetSpawnFocusPos() { - if (Ped.Instance) - return Ped.Instance.transform; + var ped = Ped.Instance; + if (ped != null) + return ped.transform; - if (Camera.main) - return Camera.main.transform; + var cam = Camera.main; + if (cam != null) + return cam.transform; return null; }