Null reference exception only in builds when changing Polyline thickness
Changing Polyline thickness in runtime works great in Editor play mode.
In build though I get a null ref exception.
My calling code:
var lineRenderer = polyLineObject.GetShapeRenderer() as Shapes.Polyline; lineRenderer.Thickness = settings._thickness;
Stacktrace:
UnityEngine.EventSystems.ExecuteEvents.Execute | System.Exception: NullReferenceException Stack: Shapes.ShapeRenderer.VerifyComponents () (at <project>/Shapes/Scripts/Runtime/Components/ShapeRenderer.cs:236) Shapes.ShapeRenderer.ApplyProperties () (at <project>Shapes/Scripts/Runtime/Components/ShapeRenderer.cs:536) Shapes.ShapeRenderer.SetFloatNow (System.Int32 prop, System.Single value) (at <project>/Shapes/Scripts/Runtime/Components/ShapeRenderer.cs:592) Shapes.Polyline.set_Thickness (System.Single value) (at <project>/Shapes/Scripts/Runtime/Components/Polyline.cs:67)
Anything I am doing wrong here?
Notice:
I added all Shapes Shaders in "Always Included Shaders" section
Okay I can confirm that this was a mistake on my side.
Destroyed gameObjects, had references left on Shapes.Renderer and of course no MeshRenderer exists or can be created anymore.
Sorry for all of this! You can close this.