To create the ghost trail effect we will create a new function.

This function creates a fading ghost trail by copying the player’s appearance, adding it to the scene, and gradually making it transparent until it disappears.