I’m making a skill tree and I have the following problem, when I use ‘‘Remove from parent’’ the acquired skills are not saved, but when I use ‘‘Set visibility’’ they are saved but I can only drop the skill to actionbar when the widget is add to the viewport, how can I solve this problem?
Hey there @Pocquer! Welcome back to the community! Just judging by the way you described the issue, it sounds like your game logic is dependent on the widgets to exist/function. This is counterintuitive to systems that are meant to be persistent like skills.
Without seeing your project/BP, my best recommendation would be to make your skills work from a separate BP altogether, possibly attached to your character, and then have the widgets/UI only check that BP and display what’s there. This makes it so if you remove your UI, it has no effect on your skills, and keeps things nice and tidy.
If I created a Structure to store the UI information ? Could it work
?
(I trie and it still didn’t work)
Not quite, so instead of making the UI information a struct, derive your UI from the game variables directly instead of having them hold the variables themselves.
A good example would be to keep track of your skills themselves on your player, then when you open the UI just have it check that skill information from the player instead of the reverse, so if you have to destroy the UI it doesn’t affect gameplay.
Here Ryan Laley has a series about setting up a basic skill system, you can skip to the 3rd episode onward to see how he sets up the UI portion, though seeing the first couple of episodes might help grasp his reasoning. His UI is totally decoupled from the skills data table and only checks the data on the data table when it’s created or removed. (Key episodes are past episode 3 but it might be nice to see all of it so here’s the whole list)
Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.