I’ve set up multiple objects with a gameplay tag describing each one, I’m not sure how to apply tags but I’ve made a tag container variable in each object and set the tags in there and looking in the class defaults is says the tags have been applied, but when I try to use a gameplay tag switch it fails to recognise them. Am i doing something wrong? Heres my setup:
When given an object with the tag Grabbable.Ball in its tag container it responds “object has no tags” as its told to do in case 0, when no tags are pressent. Heres what my objects look like:
I’m not really sure what I’m doing wrong here, my old guess would be the switch is looking for the wrong thing or I should be using a gameplay tag switch rather than a gameplay tag container switch but I’m unable to get only the tags from the object I’m given and can only get a container from it
any help or advice would be appreciated, I’m pretty stuck!
oh nice, thanks, I’ll try out this system tho I think unreal engine sometimes changes names to work stuff so it might break, I remember seeing someone saying using names was a bad idea but that might have only been object names
No these are not names in that sense. The variable type is ‘name’, yes, but the tags are whatever you want to put in there. I use it all the time, no problem.
Using the name of objects you see in the editor, separate thing. Probably not a good idea.
It’s not as elaborate as this gameplay tag system, but unless you specifically want hierarchical complexity like that, I’d stick with plain old tags.
Oh nice, thank you! This has had me stumped for a decent few hours, yea my original system read the objects name and the editor kept adding numbers on the end of it breaking my system
ok weird, I tried breaking it and i got the same issue but printing out the name of the tag at index 0 says the name of the tag is notag so I’d assume the tags havent been set properly or cant be retrieved
By default, the “Get Owned Gameplay Tags” interface returns a tag container that is empty. To utilize this function, you’ll have to override the interface in cpp.
But another thing you can do if you don’t want to code is to make your own interface. The interface function would return a gameplay tag container, and in the classes that implements the interface, you provide the function with the gameplay tag container variable.