If you’re spawning the attack in the controller already, you do not need any casting at all:
Cast is necessary when you’re unsure what kind of object you’re dealing with. In this case, you just spawned the very object you wanted and can set reference directly.
In blueprints this is referred to as direct communication.