Pardon for necro-posting, but I thought I had a reply for this.
Hope I understood the question: Ihave a situation where I’m finding it difficult to get around without pass-by-ref in custom events.
To start, I’m using TCPSocketConnection (a 3rd-party plugin) which I’m using to connect to TCP server which returns some results based on queries that I send it.
TCPSocketConnection utillises event delegates. When it connects to the server via its OnConnected event, the OnMessageReceived delegate is called when the server returns a message. I’d like to store the return based on the command I sent; different variable for a different command.
If pass-by-ref worked in custom events, I would be able to neatly create any number of functions that have a command string and a ref-var. Both will be dispatched to the TCP connection which stores the returned value by ref-var.
This graph shows where I got to before I realised pass-by-ref didn’t work for custom events.
Note that the func Get Stockfish Fen called DispatchTCPConnect_Event, passing the command and ref-var:
And I hoped that the Stockfish Fen would be pased by reference.
Using UE 5.1.0.

