LOCKS+ Dial Pad integration with Realistic FPS Prefab


Import LOCKS+ package into your project ( don’t include Project Settings ), let’s open the RFPS demo scene We’ll need to do several things to make the Dial Pad system work well with RFPS But first let’s drag one of the lock prefabs to see how they would behave in the scene If you run the game and go up to the door, you’ll notice that you can’t interact with it at all In order to interact with the door we need to give it the “Usable” tag from the RFPS project Select the “Door” object from inside our prefab. Here you’ll find the “Activator” which we can interact with Change the tag of this object to “Usable” and test the game again Now we can interact with the door and activate the lock object, but we still can’t play the puzzle game This is because we need an “EventSystem” in order to use Unity’s UI buttons. Let’s add one to the scene We also need to change the Input names in the Event System because they are different in RFPS Now when testing we can activate the lock and play it perfectly. Notice that there is no keyboard/gamepad input because of the way Inputs are set in RFPS Let’s try the bomb lock and see how we can integrate it into the RFPS explosive system If we go up to the bomb prefab in the scene we can’t interact with it because it doesn’t have the “Usable” tag So let’s add it! The interactive part of the Bomb is the root object of the prefab, so set the “Usable” tag there Seems to work perfectly Let’s try it again, notice how when we interact with a lock, all the enemies ( and NPCs ) disappear Fail action also works fine, but it’s just a simple effect. What if we want to apply explosive damage from RFPS? This is the explosive visual effect we have on the bomb now. Let’s replace it with the explosive script from RFPS Choose one of the barrels from the scene and look at the Explosive Object script Copy it and replace the explosive script on our bomb prefab The fail action of the bomb lock calls the “Detonate” function, which happens to be in the RFPS explosive script too, so it will work without trouble Let’s try it! You’re dead, perfect! Since this is the native explosive script from RFPS, you can also shoot it to detonate it You are not limited to just this “Detonate” action. If you look inside the scripts of RFPS you can find more functions to call, based on the action you want to do So experiment around and try different function, or make your own to create engaging interactions for your players. Have fun!

Leave a Reply

Your email address will not be published. Required fields are marked *