The code for interaction looks a lot like what is done in UAITask_UseGameplayBehaviorSmartObject
. You can find and claim the SmartObject slot for the player Pawn. You will use UGameplayBehaviorSubsystem::TriggerBehavior
with your Pawn as the Avatar. You will need some other logic for limiting player actions and/or canceling the interaction and releasing the slot.
You can find the slots either with a spatial query using the SmartObject subsystem or directly from a SmartObject component.
You may want a different behavior for the player than an AI agent, and you can supply multiple behaviors to a slot and use tags for filtering which one is chosen based on the interacting actor.