NullReferenceException: Object reference not set to an instance of an object?

Avatar
  • updated

I am doing docs on the website(https://acegikmo.com/shapes/docs).

The first below code is working well.

But If I use PolyLine or Disc, then I am getting the below errors.
Could you please help with this issue?

Working Code

Image 841

Not Working Code

Image 842

Errors

Image 843


NullReferenceException: Object reference not set to an instance of an object

Shapes.Draw.Polyline_Internal (Shapes.PolylinePath path, System.Boolean closed, Shapes.PolylineGeometry geometry, Shapes.PolylineJoins joins, System.Single thickness, Shapes.ThicknessSpace thicknessSpace, UnityEngine.Color color) (at Assets/Shapes/Scripts/Runtime/Immediate Mode/Draw.cs:86)

ReactDisc.DrawShapes (UnityEngine.Camera cam) (at Assets/Scripts/ReactDisc.cs:37)

Shapes.ImmediateModeShapeDrawer.OnCameraPreRender (UnityEngine.Camera cam) (at Assets/Shapes/Scripts/Runtime/Immediate Mode/ImmediateModeShapeDrawer.cs:30)

Shapes.ImmediateModeShapeDrawer.DrawShapesSRP (UnityEngine.Rendering.ScriptableRenderContext ctx, UnityEngine.Camera cam) (at Assets/Shapes/Scripts/Runtime/Immediate Mode/ImmediateModeShapeDrawer.cs:37)

UnityEngine.Rendering.RenderPipelineManager.BeginCameraRendering (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera camera) (at <9ae153a4144543aca4f16814b7ce3264>:0)

UnityEngine.Rendering.RenderPipeline.BeginCameraRendering (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera camera) (at <9ae153a4144543aca4f16814b7ce3264>:0)

UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List`1[T] cameras) (at Library/PackageCache/com.unity.render-pipelines.universal@14.0.11/Runtime/UniversalRenderPipeline.cs:376)

UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List`1[T] cameras) (at <9ae153a4144543aca4f16814b7ce3264>:0)

UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, UnityEngine.Object renderRequest, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <9ae153a4144543aca4f16814b7ce3264>:0)

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Reporting a bug? please specify Unity version:
2022.3.41f1
Reporting a bug? please specify Shapes version:
4.3.1
Reporting a bug? please specify Render Pipeline:
URP