Combination lock system?

I’m trying to create a combination lock system.
For example, there is a briefcase with lock combination and when i approach it and press E, the combination lock system must pop up on the screen and i should be able to enter a combination.

How should i go about doing this?

You picked one the harder locks to replicate in a game, lol. A keypad is much simpler to implement.
Seriously though, The pop-up combination lock would be a UI widget. On the character blueprint (or wherever you’re registering the E press) if you’re in range of the briefcase (use a sphere collision on the briefcase BP) and the player hits E, create a new lock widget, add it viewport, and lock the input mode to UI only. After that you would need to use a system of images. The easiest way would be to have two images, a static outer lock image, and then the numbers part of the lock which would rotate when the player does whatever would rotate the lock. You’ll have to do some trial and error to get the rotation to match with the numbers. That’s the easy part though. The hard part would be getting the variables to check if the combination is correct. What you could do is set an array of all the numbers on the lock. Also have an array for the proper combination as a variable as well. Have your lock widget image always start at the first number in the array. Then, every single time you rotate the lock once (I would use two keys to rotate numbers), you access the next number in the array and save it to a variable. You could determine which way the player is turning the lock(by which key was pressed) and iterate through the array accordingly. Of course when the player goes over the amount of numbers on the lock you’d have to change it back to the beginning. Then have the player press e or something to confirm that selection and have another array for the player’s lock input. If you want it to act like an actual combination lock you could lock the rotation to only one way and then switch it after each number selection. Or even realer, let the player got he wrong way but void out their lock input array anytime the player doesn’t go the right way. Then all you would have to do is check if the input array matches the correct combination array.
There might be an even easier way that I’m not thinking of but this is all I’ve got for right now. Hope it helps.

A little bit of using my mind, i think this can be done! :stuck_out_tongue: but i need help in pointing me in the right direction. How do i change the image in the widget once i click on it? do i have to add a binding to an image and create a node on onmouse click?

So i figured out how to do this, you will have 3 int variables, images1,images2,images3 or you can have a single images array with 3 indices. the printing for the number when clicked on it is shown below.

Can anyone get in deepth with this im trying to do this, but i got no clue how to … im in the 4.18 version’s of unreal