Shader field modified in script appears to reset in vertex shader

Hello, I have a rather weird problem when passing a shader value from script
The value appears to change when running the program, but when I use it in the vertex shader, there is no change
The field that I modify is _CurrentAngle and it changes correctly in the Update() method from the c# script
BUT when I want to use it in the vertex shader( float angle = _CurrentAngle), it appears to have reseted.
When I change it like this

float angle = _Time * 30

it works as intended. But I need to be able to pass values from outside the shader
Please help.
Thank you

My shader code:
Shader “DisplacementShader”
{

Properties
{
_AppliedColor(“Applied Color”, Color) = (0, 0, 1, 0.5)
_Texture(“Texture”, 2D) = “blue” {}
_CurrentAngle(“_CurrentAngle”, Float) = 0
}
SubShader
{
//ZWrite Off
Tags {“Queue”=“Transparent” “IgnoreProjector”=“True” “RenderType”=“Transparent”}
LOD 300
Alphatest Greater 0.05
ColorMask RGBA
Pass
{

CGPROGRAM

#pragma vertex VertexShaderFunction
#pragma fragment PixelShaderFunction
#include “UnityCG.cginc”

sampler2D _Texture;
float4 _AppliedColor;
float _CurrentAngle;

float4 _Texture_ST;

struct vertexShaderInput
{
float4 Vertex : POSITION;
float3 Normal : NORMAL;
float2 TexCoord : TEXCOORD0;
};

struct vertexShaderOutput
{
float4 Position : SV_POSITION;
float2 UV: TEXCOORD0;
};

vertexShaderOutput VertexShaderFunction(vertexShaderInput input)
{
vertexShaderOutput output;

float x = input.Vertex.x;
float y = input.Vertex.y;
float z = input.Vertex.z;

float angle = _CurrentAngle;
// float angle = _Time * 30;

y = sin( x + angle) + cos(z + angle);
y *= x * 0.06f;

float4 deformedPosition = float4(x, y, z, 1);

output.Position = mul(UNITY_MATRIX_MVP, deformedPosition);
output.UV = TRANSFORM_TEX(input.TexCoord, _Texture);
return output;

}

fixed4 PixelShaderFunction(vertexShaderOutput input) : COLOR
{

fixed4 outputColor = tex2D(_Texture, input.UV) ;

return outputColor;
}
ENDCG
}
}
Fallback “VertexLit”
}

the script code
public class super_Script : MonoBehaviour
{
public float currentAngle;
public float rotationSpeed;

void Start ()
{
rotationSpeed = 30;
currentAngle = rotationSpeed * Time.time;
}

void Update ()
{
currentAngle = rotationSpeed * Time.time;

renderer.material.SetFloat(“_CurrentAngle”, currentAngle);

}
}

You know there’s an _Time value that’s built into the shader?

float4 _Time;

with _Time.x being the equivalent of Time.time (I think).

You could simply use that and then all you need to provide to the shader is the rotation speed as a property (which means you could do away with your entire script).

In my absent minded way of writing code I declared _CurrentAngle as float4, and not as float

I am so ashamend… :expressionless:

Thank you for taking your time to answer silly posts on the forums
Have a wonderful day