How do I make this into a shader?

How do I create a shader out of this? I’ve never tried anything like it, and would really appreciate some help. Got this off of a link in google that people are allowed to use and I don’t know how to put it into a shader.
Thanks.

Shader “Game/Unlit/Vector”
{
Properties { }

SubShader
{
Tags { “Queue”=“Geometry” “RenderType”=“Opaque” }

Pass
{
CGPROGRA$$anonymous$$
#pragma vertex vert
#pragma fragment frag

#include “UnityCG.cginc”

struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
};

struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
};

v2f vert (appdata v)
{
v2f o;

o.vertex = UnityObjectToClipPos(v.vertex);
o.color = fixed4(v.color.rgb, v.color.a);

return o;
}

fixed4 frag (v2f i) : Color // was SV_Target
{
return i.color;
}

ENDCG
}
}
}

That’s pretty much the default shader you get when you click Create->Shader->Unlit Shader (except for the $$anonymous$$ in there). This creates a shader file that you can assign to a material.

See here for more info:

Been trying very hard to get a shader to allow Vertex Colours to show in Unity URP. Kinda about to give up. Could I get a bit more help than that? A personal explanation for my specific question would really go a long way.

What specifically are you trying to accomplish? Just create a vertex color shader? Or something more? Do you need lighting support? It is easier to give personalized help if you provide some context.

If you’re willing to use ShaderGraph (which I believe it’s the best option if you’re not comfortable with shaders/programming in general) making a vertex colors shader is quite simple. This might help:

https://www.youtube.com/watch?v=YfyFqUemD40