If the spell is no longer on the stack when the triggered ability resolves, the mana value of the spell is still remembered.

Artwork
Loading artwork…
Veiled Sentry
Urza's Saga · #109 · EN
Nonfoil—Foil—
Card rules
When an opponent casts a spell, if this permanent is an enchantment, it becomes an Illusion creature with power and toughness each equal to that spell's mana value.
Uncommon · Illustrated by Ron Spears
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
PreDH Legal
Premodern Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
It triggers when the spell is cast, which means it becomes a creature before that spell resolves.
When it turns into a creature, it is no longer an enchantment.
It changes into a creature even if the spell is countered.