Is it possible to add a control function at the agent level for Gathering/Performing?

Masking is coming in 5.6. It’s currently available on UE5-Main if you compile from source.

We still need to finish testing it so it may contain bugs but it’s “code complete” and we did some preliminary testing.

Not sure what you should do in the meantime. Best you could do with the tools available would be to Terminate the episode with a negative penalty and the policy should eventually learn not to do invalid moves, but that’s not a great solution (IMHO).

Brendan