Polyline does not clear mesh when point count <2

Avatar
  • updated
  • Fixed

I was writing a quick and dirty polyline animator and noticed that when the point count is < 2 the line mesh is not actually cleared, persisting the mesh that was last generated for the polyline when its point count was >= 2.

Image 849

I took a look at the `GenPolylineMesh` function and while it clears the managed mesh data, it returns early when point count is <2, before assigning to the mesh.

Image 850

I was able to work around this by manually calling `polyline.Mesh.Clear();` but wanted to call it out!

Reporting a bug? please specify Unity version:
2022.3.45
Reporting a bug? please specify Shapes version:
4.3.1
Reporting a bug? please specify Render Pipeline:
URP
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Fixed

o, rip, fixed now!

Avatar
Freya Holmér creator
  • Answer
  • Fixed

o, rip, fixed now!

Avatar
Quote from Freya Holmér

o, rip, fixed now!

💙