title: Unity - Particle Effects: How can I make the Shader play in the desired time
body: <p>Lately I've been trying out my luck on VFX. I've come across effect that I like very much, the Scrolling Shader.</p>
  
  <p>I was basing myself on <a href="https://www.reddit.com/r/gamedev/comments/ftp0s8/scrolling_energy_shader_breakdown/" rel="nofollow noreferrer">this post</a> and managed to get in touch with it's creator, so shoutout to him, and he guided me in the right direction to achieve the desired effect.</p>
  
  <p>Later, I realized I had a few errors that, if someone can help me with, I would much appreciate it.</p>
  
  <p>The effect is simply the texture scrolling through a certain mesh, masked with a alpha texture.</p>
  
  <p>First issue: The effect has no color... It rotates and the alpha mask is fixed but the color does not show.</p>
  
  <p>Second issue: I'm using this shader to complete a specific part of an effect, using the Particle System. I used the Color Over Lifetime option but it still activates as soon as the whole effect starts. With the Start Delay option, it works.</p>
  
  <p>In a way the problem is fixed this way, altough I would like to know how I could this slowly appearing like the Color Over Lifetime.</p>
  
  <p>Final question as in more of a bonus.</p>
  
  <p>Is there a way to slowly making the mesh appear, alongside the shader effect, from bottom to top?</p>
  
  <p>Current Shader code</p>
  
  <pre><code>Shader "Custom/ScrollingShader"
  {
      Properties
      {
          _MainTex ("Texture", 2D) = "white" {}
          _AlphaMaskTex ("AlphaMask", 2D) = "white" {}
          _ScrollSpd ("Scroll Speeds", vector) = (-5, -20, 0, 0)
          [HDR] _Color ("Color", Color) = (1, 1, 1, 1)
      }
      SubShader
      {
          Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
          // No culling or depth
          Cull back ZWrite Off ZTest Always Blend SrcAlpha OneMinusSrcAlpha
  
  
          Pass
          {
              CGPROGRAM
  
              #pragma vertex vert
              #pragma fragment frag
  
              #include "UnityCG.cginc"
  
              struct appdata
              {
                  float4 vertex : POSITION;
                  float2 uv : TEXCOORD0;
              };
  
              struct v2f
              {
                  float2 uv : TEXCOORD0;
                  float2 alphauv : TEXCOORD1;
                  float4 vertex : SV_POSITION;
              };
  
              float4 _MainTex_ST;
              float4 _AlphaMaskTex_ST;
              float4 _ScrollSpd;
  
              v2f vert (appdata v)
              {                
                  /* v2f o;
                  o.vertex = UnityObjectToClipPos(v.vertex);
                  o.uv = TRANSFORM_TEX(v.uv, _MainTex).xy + frac(_Time.y * float2(_ScrollSpd.x, _ScrollSpd.y));
                  return o; */
  
                  v2f o;
                  o.vertex = UnityObjectToClipPos(v.vertex);
                  o.uv = TRANSFORM_TEX(v.uv, _MainTex).xy + frac(_Time.y * float2(_ScrollSpd.x, _ScrollSpd.y));
  
                  o.alphauv = TRANSFORM_TEX(v.uv, _AlphaMaskTex).xy;
  
                  return o;
              }
  
              sampler2D _MainTex;
              sampler2D _AlphaMaskTex;
              float4 _Color;
  
              fixed4 frag (v2f i) : SV_Target
              {
                  fixed4 col = tex2D(_MainTex, i.uv);
                  fixed4 colA = tex2D(_AlphaMaskTex, i.alphauv);
  
                  col = tex2D(_MainTex, i.uv) * _Color;
  
                  col.a = tex2D(_AlphaMaskTex, i.uv).r;
  
                  col = tex2D(_MainTex, i.uv) * tex2D(_AlphaMaskTex, i.alphauv).r;
  
                  return col;
              }
              ENDCG
          }
      }
  }
  </code></pre>
  
  <p>Mesh used with material applied:</p>
  
  <p><a href="https://i.stack.imgur.com/3pNQT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3pNQT.png" alt="enter image description here"></a></p>
  
  <p>Thanks in advance and if there's something that you don't understand, please bring it to me so I can try to explain better.</p>
  
  <p>Thank you very much!!</p>