how to make object follow using c# script

hi everyone in my game there is a ball which will be moving in y axis by jumping from platform to platform
and there is a empty object with destroyer script( if the object with player tag collides with destroyer game will over) now what I need is when ball move upwards destroyer should move upwards but if the ball moves downwards the destroyer should not move downwards instead it should stop moving and stay where it is so that it can destroy the ball ; if you can’t understand me I will attach link to the video of a sample game

Good day.

How are you moving the ball? We need to see the code.

You just need to make tje destroyer move with the ball when movement is positive and dont move when is negative.

Show us the movement code please!