The last ability of Illusory Gains doesn't target the new creature. It will become attached to that creature even if that creature has hexproof or shroud.
Illusory Gains
Illusory Gains's last ability is mandatory. You can't choose to have Illusory Gains not move.
If Illusory Gains can't legally enchant the creature that enters the battlefield (perhaps because it has protection from blue), it remains where it is. You retain control of the creature it's currently enchanting.
Magic: The Gathering · ™ & © Wizards of the Coast · Illus. Kev Walker
Card data via Scryfall. Rarix is fan-made; not endorsed by the rights holders.
