I want to put special abilities in my character, but i want to try something new. Like putting a variable on the powers. Ex: lets suppose that my main character has the power to pull the enemies for him or push them away,but i want these powers to be in the same button. and the way to alternate between both powers is using the mouse scroll (that you can also use for change the strenght of the powers,the speed that you can push/pull etc). I cant tell much more about this game,but i’m really trying hard to find any clues on how can i do it. can somewone help me with this?
Split your problem into smaller ones, repeat until you have so small problems that solution to them is obvious to you.
Your question is a bit complex, you have at least 4 separate problems here:
- making abilities
- learning how events work
- making simpe umg menu to switch powers
- learning where to put your post in forum
So start from watching tutorials, there are plenty tutorials that explain such problems.
Ps. Not sure if you want to make it in C++ or not, so i am not moving this.
If you are looking for a “static” solution you could simply use an enum variable (or a simple uint8) for each power and then when the button is pressed call the function associated with the current value of the enum. It’s not a very elegant solution but it works.