How do you melee

How do I make my knife for my FPS game, knife when I want it to. Do I have to make an animation for the stabbing?
Please help.

Make an animation for the stabbing, and then there are any number of ways you can implement the actual attack. Decide how you’re going to do that, and then come back here when you have a specific question you want answered. Here are a few of your choices-

Raycast out in front of the player like a very short-range bullet

Use the animation to get the physical location of the knife (not recommended since it is naturally unstable)

Do some kind of ‘sweep’ in front of the player, like an arc (again depends on exactly how the knife animation works).