The floating dagger appears in Act 2, Scene 1 (not Act 1). As Macbeth prepares to murder Duncan, he hallucinates a dagger pointing toward the king's chamber.
This soliloquy reveals Macbeth's psychological unraveling and foreshadows the bloodshed to come. The dagger is both a product of his fevered imagination and a summons from the dark forces he has invoked.