I sent you a PM but I’ll explain a bit here. In your widget blueprint, select the UMG button you want to use. On the right, scroll down until you see “Events” and click on the OnClicked event. That’ll take you to the graph and add the event. Now from there you want to get your mouse location. To do that use “GetPlayerController” and use that return value to “GetHitResultUnderCursorByChannel”
You’ll break the hit result and you’re going to want to use “Location” or “ImpactPoint”
To be honest, I don’t know what the difference is. Both of those usually give a pretty good idea of where in the 3D world your mouse is. Use that location as the spawn point for your AI. Now if you do that, it’ll spawn right under the UMG button because that’s where your mouse is at the time. My suggestion is use EventTick to set the newly spawned AI’s location to that cursor location you got. Then with a click (left or right, up to you) have a DoOnce that will stop setting the new unit’s location. You can use a Gate for that. Here is a picture of what I’m talking about:
This is a very simple way of doing it but it definitely works.