Hey Folks, Some context before the question.
This is probably for more advanced Blueprint scripters and programmers.
Context: I’m trying to make a weapon switching system based on the mouse scroll wheel input, As the player scrolls up or down, it increments or decrements respectively either plus or minus 1 byte, this then checks if the player has unlocked the weapon to begin with against an array index, if true then sets the weapon, if false sets to next true index in array.
-
I have an Enumeration for the Weapons
set up with the Weapons listed. -
I have an array of bools (that’s
supposed to check unlocked weapons against the Enum).
How do I increment and decrease through ONLY unlocked weapons, whilst skipping locked weapons?
For example- if in the Enum 0=Pistol, 1=Shotgun, 2=MP5, 4=RPG and only the Pistol and RPG is Unlocked (set to true in separate Boolean array). How can I scroll between these two only? Which would be switching between the 0 and 3 index. -These values would then ultimately be used to drive the WeaponEnum setter, to which I can then use an Enum Switch to drive the weapon firing functionality.
I hope that explains my predicament, Any help would be absolutely appreciated! Thank you.