Problems building animation with completely scripted objects - everything is pink!

Hi.

I’m making an animation for an artist, converting to Unity after 10 years of ActionScript.

It’s purely code, there are no assets or materials at all, I use vertices on the fly to create shapes and then colour cycle them.

I’m using UniversalRenderPipelineAsset, and when I run the code, the shapes get a ‘Lit (instance)’ of shader Universal Render Pipeline/Lit.

Works as expected in the editor, but when I build, I just get the default pink for the colours.

Can someone help - I’m thinking of re-making the whole thing in Phaser!!

I obviously need to tell it what I’m using for the build, but can’t figure it out.

Here’s what I tried:

  • Adding a material ‘Lit’ to a material folder in my assets
  • Added all the ‘UI/Lit/’ options to Always Included Shaders in the Graphics settings
  • Checked ‘Keep All’ in Shader Stripping Instancing Variants
  • Little bit of crying.

Thanks.

I helped to fix this. Someone else had suggested using the URP to solve the issue, but this was incorrect. This was solved simply by assigning a Material with an Unlit/Colour shader to the MeshRenderer’s material at runtime, after the MeshRenderer component had been created and assigned to the created Mesh GameObject.

Thanks for your help @TSLoire

We did 2 things: stopped using URP and added a material to the project with the UNLIT > COLOR shader.