x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: UE 4.9
Tags:
more ▼

asked Mar 25 '16 at 04:00 PM in Blueprint Scripting

avatar image

sourabhhamigi
58 5 4 8

avatar image FAAC_Axel Feb 19 '18 at 02:12 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

capture.jpg (86.0 kB)
more ▼

answered Mar 30 '16 at 02:51 AM

avatar image

sourabhhamigi
58 5 4 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Mar 26 '16 at 05:40 AM

avatar image

Alex8546
178 10 8 21

avatar image sourabhhamigi Mar 27 '16 at 05:40 AM

A little bit of using my mind, i think this can be done! :P 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?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question