- Home /
How to: make a user press a combination of buttons to play an animation. for example door open.
How would i make a number combination lock, i know i need the buttons and a script but dont know what script.
Anyone got one that they can share?
Can you describe, in more detail, exactly what you're trying to accomplish? It sounds like you want a lock - does this mean you want one to appear on screen that the player has to interact with? If so, how? Are the buttons represented on-screen as part of the lock? Have you done any scripting before? It's not likely to find a custom script for exactly what you want, so try to break the problem down into the smallest pieces you can and solve them one by one.
Answer by logty · May 02, 2011 at 08:43 PM
if you needed just a combination of buttons you could use:
if( Input.GetKey(KeyCode.O) && Input.GetKey(KeyCode.P) && Input.GetKey(KeyCode.E) && Input.GetKey(KeyCode.N) /*... and so on */)
{
Animation.Play( YourAnimation );
}
Based on the title of your question this might be what you are looking for, do you have anything more specific?
Well basically i want buttons on the floor that i can stand on in a certain sequence that will then play an animation once the correct combination is input.
Your answer
![](https://koobas.hobune.stream/wayback/20220613130945im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
key to open gate 1 Answer
Opening an animated door with a keycard 0 Answers
Pick up key and unlock a locked door 1 Answer
isTrigger door issues 1 Answer
why isn't my lock working 1 Answer