Shapes don't show if colours aren't initialised in code

Avatar
  • updated
  • Not a bug

If you e.g. write

Draw.Disc(Vector3.zero, 1f, colourBkg);

where you previously declared 

public Color colourBkg;

It doesn't show - even when you change the colour in the inspector. You have to initialise the color so e.g. 

public Color colourBkg = Color.magenta;

for it to work. You can then change the colour in the inspector.

Reporting a bug? please specify Unity version:
2021.3.1f1 Apple Silicon
Reporting a bug? please specify Shapes version:
4.1.3
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
Freya Holmér

when you add a color field, it defaults to (0,0,0,0), which is invisible black


The "even when you change the color in the inspector" part can't be true unless there's a really weird unity bug - can you make sure this is actually happening?


make sure you don't have multiple instances etc in your scene

Avatar
bobbobs
  • Not a bug

Ah ok actually ignore this. The issue is me not seeing I needed to change the alpha in the inspector. Although I think the way unity shows zero alpha colours in the inspector is very unhelpful. Anyway will delete this in a bit unless there's a way of marking as closed?