user4007: After effects noob here. I'm working on an animation where a ball falls through a hole. I created a Shape layer to use as the mask, but I can't get it to mask the ball layer.
I've also tried adding a mask directly to the ball layer, but it moves with the rest of the animation. Is there a way to turn the mask on and off without affecting the rest of the animation?
 

user5172: In these cases, I generally precompose the layer and apply the mask to the precomp (the layer is animating inside the precomp)

user4007: I found this post helpful: Preventing a Mask From Animating 


Create a comp size solid above your text layer.  
Apply the mask to the solid.  
Set the Track Matte setting of your text layer to Alpha Matte.
The text layer will now adopt the alpha channel of the masked solid.

You can freely animate the text and mask independently.

I did not know the name of what I was trying to do. I needed to convert the mask layer into a Track Matte. 

4007: <p><strong>After effects</strong> noob here. I'm working on an animation where a ball falls through a hole. I created a <code>Shape layer</code> to use as the mask, but I can't get it to mask the ball layer.</p>

<p>I've also tried adding a mask directly to the ball layer, but it moves with the rest of the animation. Is there a way to turn the mask on and off without affecting the rest of the animation?</p>

<p><img src="https://i.stack.imgur.com/J717t.gif" alt="Ball not being masked"> </p>
 5172: <p>In these cases, I generally precompose the layer and apply the mask to the precomp (the layer is animating inside the precomp)</p>
 4007: <p>I found this post helpful: <a href="http://forums.adobe.com/thread/704283" rel="nofollow">Preventing a Mask From Animating</a> </p>

<blockquote>
  <ol>
  <li>Create a comp size solid above your text layer.  </li>
  <li>Apply the mask to the solid.  </li>
  <li>Set the <strong>Track Matte</strong> setting of your text layer to <code>Alpha Matte</code>.</li>
  <li>The text layer will now adopt the alpha channel of the masked solid.</li>
  </ol>
  
  <p>You can freely animate the text and mask independently.</p>
</blockquote>

<p>I did not know the name of what I was trying to do. I needed to convert the mask layer into a <code>Track Matte</code>. </p>
