Go into your actors construction script an see if you can add the event OnClicked. If this exists in construction you should be able to use it just like you would in the eventgraph.
Hi. I am dealing with the same kind of problem. Although I am using UE 5.5. But I dont know which function works in such a way. I tried many methods in Construction Script. All are invain.