rend.material.SetVector("_MyCustomFloat4", new Vector4(1f, 1f, 1f, 1f));
Please be aware that you’re creating a new instance of the material and setting properties on that reference by accessing the “rend.material” property. If you’d rather set the property without creating a new instance, use “rend.sharedMaterial” instead.
Material mat = rend.sharedMaterial;
mat.SetVector("_MyCustomFloat4", new Vector4(1f, 1f, 1f, 1f));