Cannot get NPC to use smartobject with matching user (gameplay) tag(s)

Hi, I’m trying to learn smart objects and I’ve had some success so far. I can set up smartobjects in my world and NPCs will animate when they use them. However, I want to use user tags to define who can use which smartobjects, and I can’t seem to figure it out.

On the smartobject definition I have a query tag filter set up. It looks like this:

If I run the game without adding any tags to the NPCs, they will refuse to use the smartobject in question as expected.

I tried to add tags to the NPC by creating a variable of type “gameplay tag container” with the proper default value to the BP_ThirdPersonCharacter blueprint I’m using. I verified that this default value is set in the details for the character in the world like so:

When I run the game, the character still refuses to use the smartobjects that require this tag.

I read somewhere that I have to do this through the NPC’s “ability system” component and an “add loose tags” node, but I cannot figure out how. The NPC didn’t seem to have this component already, so I added one and tried to connect it to the node, but it won’t connect.

What am I missing here?

The first example with the variable can’t work because that variable isn’t registered anywhere and the engine won’t know to look for it, but you figured out that part.

The second example doesn’t work because you’re trying to plug in the component into the actor pin, just plug in your actor (or if this is happening in your actor’s blueprint, just plug in Self).

Thanks, I figured it out, I had a filter set in the BP that looks for smartobjects and the filter was set to “none” for tags, so the NPCs were literally looking for smartobjects with no tags.

I just got a reference to the variable I made in that BP via a cast and plugged that into the filter instead. It seems to work ok now.

2 Likes