If my character takes damage the game freezes totally

Ok so I figured out the problem is when the character gets close to the enemy the game freezes