Note: the features here require C++ at least as of Unreal Engine 5.4.2.
Smart Objects support passing in additional data into them during both finding them and when claiming slots.
This can be done via extending FSmartObjectActorUserData and USmartObjectWorldConditionSchema. For example, if you wish to include a Gameplay Tag in the smart object request, you can create a subclass of FSmartObjectActorUserData
which includes the tag, and extend USmartSmartObjectWorldConditionSchema
with a new schema which reads the tag from the custom user data struct.
There is a code example for this in SmartObjectTypes.h
, in a comment on the declaration of FSmartObjectActorUserData
To pass in the extra data, you need to use the C++ smart object APIs, such as FindSmartObjects
which allow passing in a FConstStructView
. This also means you may need to create custom AITasks or BT tasks, as the default implementations don’t allow for passing additional data.