How do I get the computer to pick a random button widget

Zoe Parsons
Mon, 03 May 2021 18:51:14 +0000
UI

Hey there, I’ve just been trying to program a mechanic in unreal but I’m having some trouble figuring out how to get it to work properly. I’m trying to make a choice system where you have to try and pick the right answer to something. So when the game starts, the computer will pick one of the answers out of a list of them, and you have to try and click on the right one.

Each time the game ends / starts again, the computer picks a different answer. If you pick the right one, you win the game, but if you pick the wrong one then you lose and the game starts again. I’m basically struggling on how to get this random answer picking mechanic to work - I know you can use stuff in unreal that makes a random number, but I don’t know how to make this work with widget buttons instead. So far I can only really get the computer to pick a random number, instead of picking one of the widget buttons.

Sorry, I’m not too sure if I’ve explained this well ;; but any / all help and advice would be super appreciated, as I’m pretty new to programming and I’m having to make this for a class assignment.

5 posts - 1 participant