From 566f1ab7f622181490f4bc17b0d6cf98771b9064 Mon Sep 17 00:00:00 2001 From: in0finite Date: Tue, 20 Jul 2021 01:13:38 +0200 Subject: [PATCH] ... --- Assets/Scripts/Behaviours/SpawnManager.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; }