Unity3D Keypad Door unlock script c# UI System

Hey guys!

i’m working on a VR game at the moment, and since I am learning c#,  I realised that I should share my new UI Keypad script with you. This is usful for your game if you have a door with a keypad UI.

The asset that I use for the keypad textures can be downloaded for free here

So, attach this script to any object, and then drag in your UI buttons into the variables in the inspector, then also the code you want.  Here is the script-


//Created by Christian Blandford
using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 public class Keypad : MonoBehaviour {
     public string curPassword = "12345";
     public string input;
     public Button ButtonOne;
     public Button ButtonTwo;
     public Button ButtonThree;
     public Button ButtonFour;
     public Button ButtonFive;
     public Button ButtonSix;
     public Button ButtonSeven;
     public Button ButtonEight;
     public Button ButtonNine;
     public Button ButtonZero;
     public Button clearButton;
     public Button goButton;
     void Start()
     void PressOne() //Press Button One on Keypad
         input = input + "1"; 
     void PressTwo() //Press Button Two on Keypad
         input = input + "2";
     void PressThree() //Press Button Three on Keypad
         input = input + "3";
     void PressFour() //Press Button Four on Keypad
         input = input + "4";
     void PressFive() //Press Button Five on Keypad
         input = input + "5";
     void PressSix() //Press Button Six on Keypad
         input = input + "6";
     void PressSeven() //Press Button Seven on Keypad
         input = input + "7";
     void PressEight() //Press Button Eight on Keypad
         input = input + "8";
     void PressNine() //Press Button Nine on Keypad
         input = input + "9";
     void PressZero() //Press Button Zero on Keypad
         input = input + "0"; 
     void PressClear() // When you press clear 
         input = ""; // reset the input string to empty
     void PressGo()        //Press the GreenButton(GoButton)
         if(input == curPassword)        // if it is right 
         else {
                 Debug.Log("Wrong :(");

//I hope this helps :)

Where is night 4? + releasing for VR soon

Hey guys!


So, You might be wondering. Why haven’t I released night 4?

Welp, I am still working on it. I don’t want to release something to y’all that is buggy, hard to complete, and only like 2 endings. I want there to be broader opportunities. On how the game can be completed.

I have been getting quiet a bit of hate for this, and that’s understandable. Why do youtubers get it but I ain’t giving it to you guys? you may ask.

Well, tbh its because I sent it originally to Omar Sebali, to test it and make a video on it. Then a couple of REALLY MAJOR youtubers asked for it, like directly messaged me, Which i thought was awesome. How could I decline? It was so hard..

They found many bugs as they played, and people saw it, got angry as I did not release it to them. I want to release a good game! I want this game to be less buggy, and really scare you. I really want this project to be good.

So, I will release it soon. I will add more cutscenes, Game modes, and easter eggs in night 4.

Another question i frequently get asked, will the Toy animatronics be released in night 5?!?!?!?!?q1/1/1//exx deeeee

No. Simply no. sorry! I might do a later chapter of this game involving the toy animatronics, idk lol.

Sorry for the inactivity! I do have school xD



PS: I will release Overnight 2 for VR very soon! 🙂

Overnight 2 is IN DEVELOPMENT!


Sorry for the lack of updates  🙂

I am now making a SECOND Overnight Which is a Five Nights At Freddys fan game.

The idea of the game is a similar style to the first, you are a security guard and a kids pizzeria and you have to check the cameras and make sure nothing is up…

You see, the animatronic characters tend to have a wander….



W Freddy


Button Light




Music Box

You also have to wind up a music box. to keep one of the cursed characters happy. Just every few minutes, go any wind it up.

Because if you don’t

He will escape 🙂

You also have a mask to disguise yourself, But it will not work all of the time…

Gameplay is here –

Enjoy 😉

Overnight available for Oculus rift DK2!

well, looks like I added Oculus Rift DK2 support. Yay! The Game Now feels more immersive than ever! It still needs to be polished, the scale is off! 😀


you are the size of a chair….

A mac version of the oculus will never be available… 🙁

enjoy being killed by robots and stuffed into suits! LOL 😀

Download (Windows)

Five Nights at Freddy’s Fan Game, Free Roam! ~Overnight

Well, I made  A five nights at freddy’s fan game (A remake of another game but with a twist), called “Overnight” Because I decided to take a break from behind XD


You can download both mac and PC versions here (It doesn’t need the Oculus rift but I may add support for it soon)

Download Here

Keys – use arrow keys or WASD to move around, mouse to look around, shift to run, click on the red button to close doors, green ones to turn the lights on and off. The doors use power and you do not have much! Can you last until 6am?

Five nights at Freddy’s is a very unique horror game which takes a step away from clichés. For me, this game throws all my fears at me-

  1. Creepy animatronic character robot things in a kids pizza restaurant  ( That should explain it all :D)
  2. Having Them Chase you with haunting footsteps creeping up behind you

The Way Five nights at freddys works is you are a security guard in a kids Pizza Restaurant and you have to monitor them on security cameras but as you can imagine they obviously do not want to stay in the same place. They want to come after you and stuff you into metal suits until your eyes and feet pop out the bottom! YAY!

Here is a lets play this game, But he was having a problem when some of the robots were walking through doors! Don’t worry that’s been fixed in the latest update!


First Post!

Hello! This is the first post on what I hope will be a regular blog! The aim to post updates on development of my games. At the moment am working on “Behind” a virtual reality game for the oculus rift. I will do a version for normal monitors too.

Okay, Today I worked on The “Bedroom Sequence”  and The “Dining Room Sequence”

You can see the videos on my Youtube Channel and Below-

Note to learning Developers-

The way I did the locked doors in my games is the following-

I have two Prefabs, one door that Opens and one door that is locked both in the same place, only One Active. ( e.g if I wanted the door to be locked I would Keep the locked door active and the Unlocked door Un-active. (If any one wants a post about how to make a door Open I will reply to you when I have time) Here is the Code I Made-

Attach to your Key Object-

*Make Sure you have A Box collider attached to the key Object, and check the “Is Trigger” and Make it big enough for the range :D*


var InRange : boolean;  //Determines If your Character is near

var DoorUnlocked : GameObject;  // assign the Unlocked Door

var DoorLocked : GameObject; // assign The Locked Door

var ForCorrutine = false;  // random Shiz ( will explain if you ask :D)

function Start(){

ForCorrutine = false;

function Update (){
if ( Input.GetMouseButtonDown(0)&& InRange){
GetComponent.<MeshRenderer>().enabled = false;
ForCorrutine = true;

function OnTriggerEnter (other : Collider){
if (other.gameObject.tag == “Player”) {
InRange = true;
if(ForCorrutine == true){                                                                                                 yield WaitForSeconds(1);
function OnTriggerExit (other : Collider){
if (other.gameObject.tag == “Player”) {
InRange = false;

Hoped this helped for any one that was struggling with Key Pick-up and unlock Door Code! 😀

Free VR games, PC and Mac games and game writing advice by Christian Blandford, 12 year old game developer!