Easy Build System (EBS)
This page covers the integration of Easy Build System (EBS) and Game Kit Controller.
Last updated
This page covers the integration of Easy Build System (EBS) and Game Kit Controller.
Last updated
Easy Build System is an advanced building system, easy to use and expandable. Fast and powerful to suit all of your building needs in all your games, works on any platforms!
Designed to work out-of-the-box, it includes several components like scalable conditions and add-ons, sockets, physics, blueprints, skins, save and load... etc
Support three view modes first, third and top-down view, works with the new Unity Input System and XR. Extend it or to customize it to fit your exact needs, even if you aren't a programmer.
You can find more information about Easy Build System (EBS), it's documentation and also purchase it over on the Unity Asset Store.
Follow these quick easy steps to integrate Easy Build System and Game Kit Controller.
Open the scene called "[Desktop] First Person - Modular Building Demo" or any first person demo scenes in the EBS demos directory here: Assets/Easy Build System/Demos & Add-Ons/Demos
and drop the GKC player prefab into the scene.
If the EBS demos directory doesn't exist in your project, you'll need to import them via the EBS package importer (Tools > Easy Build System > Package Importer > Import Demos & Add-Ons).
The GKC player prefab is located here:
Assets/Game Kit Controller/Prefabs/Player Controller/Player And Game Management.prefab
Next locate the Easy Build System - Demo First Person Controller
EBA player controller GameObject in your project hierarchy and disable it.
Select the Main Camera
child GameObject of the Easy Build System - Demo First Person Controller GameObject. Then locate the Builder Behaviour
component and copy it.
Next up you want to locate the GKC Main Camera
GameObject in your project hierarchy (Player And Game Management > Player Camera > Pivot Camera Transform > Main Camera Transform > Main Camera) and select the hamburger menu of an existing component, then press "Paste Component As New" to paste the Builder Behaviour
component onto the GKC Main Camera
.
Still on the GKC Main Camera
GameObject, got to the bottom of the inspector and press "Add Component" then we're going to create a new script, so enter GKCInputBehaviour
and then select "Create and Add".
Open the newly created GKCInputBehaviour.cs
script in your preferred editor, delete any existing content in the script so that it's empty, and paste in the code below.
You can also find a text copy of the GKCInputBehaviour script in "Assets/Game Kit Controller/Documentation/Integrations" in your project.
Save the GKCInputBehaviour.cs
script and return to Unity. You should now see something like the following:
Next we're going to link up the Player Mode that'll be used when the player wants to enter build mode.
First select the Player Controller
GameObject in your project hierarchy and locate the "Player Modes List" in the "Player States Manager" component.
Now you need to create two new events in the player mode you want the player to have the ability to build in. We're going to use an existing one for this example called "Simple Mode", but you can add a new player mode, or use another existing one if you'd prefer.
Expand your selected mode and add a new event to the "Activate Player Mode Event" list and one to the "Deactivate Player Mode Event" list. The function for both new events should be set to GKCInputBehaviour.setBuildModeEnabledState
- Now tick the checkbox in the "Activate Player Mode Event" list and leave the checkbox unticked in the "Deactivate Player Mode Event" list.
Finally drag the Main Camera
GameObject into the object field in both events you just created.
Note: A future version of the Easy Build System and Game Kit Controller integration will allow deeper integration with other systems of GKC like the inventory.
That's it! Game Kit Controller is now integrated with Easy Build System (EBS) in your project. Hit play and change the player mode ("H" key by default) to the mode you added the events to above
Now if you'd excuse me, I have to go finish building my dream home that I'll never actually own in real life... but who needs real life when you can build anything you want in GKC!