llamacademy/scriptable-object-based-guns

Sample scene errors

Lyten02 opened this issue · 4 comments

Unity version: Mac silicon 2022.3.4f1
I downloaded the project as a zip file and started the project without doing any other things

NullReferenceException: Object reference not set to an instance of an object
LlamAcademy.Guns.GunScriptableObject.GetRaycastOrigin () (at Assets/Scripts/Guns/GunScriptableObject.cs:309)
LlamAcademy.Guns.Demo.PlayerAction.UpdateCrosshair () (at Assets/Scripts/Guns/Demo/PlayerAction.cs:46)
LlamAcademy.Guns.Demo.PlayerAction.Update () (at Assets/Scripts/Guns/Demo/PlayerAction.cs:41)

NullReferenceException: Object reference not set to an instance of an object
LlamAcademy.Guns.GunScriptableObject.TryToShoot () (at Assets/Scripts/Guns/GunScriptableObject.cs:190)
LlamAcademy.Guns.GunScriptableObject.Tick (System.Boolean WantsToShoot) (at Assets/Scripts/Guns/GunScriptableObject.cs:125)
LlamAcademy.Guns.Demo.PlayerAction.Update () (at Assets/Scripts/Guns/Demo/PlayerAction.cs:26)

NullReferenceException: Object reference not set to an instance of an object
LlamAcademy.Guns.Demo.Editors.PlayerActionEditor.OnSceneGUI () (at Assets/Scripts/Guns/Demo/Editor/PlayerActionEditor.cs:28)
(wrapper dynamic-method) System.Object.lambda_method(System.Runtime.CompilerServices.Closure,UnityEditor.Editor)
UnityEditor.SceneView.CallOnSceneGUI () (at /Users/bokken/build/output/unity/unity/Editor/Mono/SceneView/SceneView.cs:3782)
UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at /Users/bokken/build/output/unity/unity/Editor/Mono/SceneView/SceneView.cs:2817)
UnityEditor.SceneView.DoOnGUI () (at /Users/bokken/build/output/unity/unity/Editor/Mono/SceneView/SceneView.cs:2485)
UnityEditor.SceneView.OnSceneGUI () (at /Users/bokken/build/output/unity/unity/Editor/Mono/SceneView/SceneView.cs:2325)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:355)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:190)

There are other errors there, just they are not so critical.

Hi! Have you followed the setup instructions to ensure you have the Unity Particle Pack installed and have a Particle System at the tip of your gun model? That error is commonly reported when the Unity Particle Pack has not been imported and a Gun model does not have a Particle System as a child.

The rest of your errors all seem to also point to a null reference related to the particle system.

Check the Quickstart on the readme and let me know if you still encounter the issue from there!

Since this has not received any updates I will close this. Please reopen a new issue if the above did not help you resolve the issue.