- UNITY REALISTIC FPS PREFAB MULTIPLAYER TUTORIAL HOW TO
- UNITY REALISTIC FPS PREFAB MULTIPLAYER TUTORIAL CODE
The error under the State field is resolved by selecting the ICubeState state from the drop-down where it says NOT ASSIGNED currently. The two errors below the Prefab Id field are resolved by running the compiler for Bolt, either through Bolt/Compile Assembly or the green arrow icon in the Bolt Assets window.
Since this is the first time Bolt sees our Cube prefab it will give you a couple of errors in the Bolt Entity component editor. To make Bolt aware of our Cube prefab add a Bolt Entity component to it, click Add Component and look up the component by name. You can delete the cube left in the Hierarchy when this is done. The first thing we are going to do is to create our prefab for Bolt, it's just going to be a standard Unity cube.Ĭreate a new cube from the GameObject/3D Object/Cube menu or right-click on the Hierarchy panel and create a new Cube, then drag it from the Hierarchy into the Tutorial/Prefabs folder in the Project tab. Go to the Project tab in Unity and create a folder called Tutorial, with two sub-folders Scripts and Prefabs. When compiling Bolt will output a couple of messages in the Unity editor console. To make Bolt aware of our state and property we need to compile it, this can be done either through the Bolt/Compile Assembly menu option or with the little green arrow icon in the Bolt Assets window. If you accidentally added more than one property or an asset you don't want, hold down the Ctrl key on your keyboard and a little red X will pop up next to all assets and properties allowing you to delete them. To create a new property to this state, click on New Property.Change the name of the state to CubeState in the first text field.Right click anywhere in the empty space of the Bolt Assets window and select New State.īolt will create a new state called NewState, and pop up the Bolt Editor window for you with that state active. Events allow you to much easier decouple the different parts of your game from each other, as you can have several listeners to a single event active at the same time.Īt the bottom of the Bolt Assets window you'll also see the version number of Bolt, whether it's built in Debug / Release mode and two buttons for compiling and saving the Bolt Assets. Commands lets you implement advanced client side prediction and automatic correction of predicted state. Commands: these are used exclusively for the authoritative features of Bolt and are used to encapsulate user input and the result of applying the input to a character in the world.You would then on the State create an array of Item objects. As an example, say that you want to create an inventory for a player in an RPG game, you could create an Object called Item and give it properties like ItemId, Durability, etc. Objects: objects are a way of logically grouping several properties in the same way you would do with a C# class.States: these are the meat of most games built with Bolt, they allow you to define things like name, health, transform, animation parameters, etc.This is done through the Bolt Assets window, which can be found under Bolt/Assets.Īssets are broken down into four categories: The only thing you need to do is telling Bolt what you want to replicate over the network.
UNITY REALISTIC FPS PREFAB MULTIPLAYER TUTORIAL CODE
The main characteristic that sets Bolt apart from other networking solutions for Unity is that there's very little actual networking code you need to write by hand.Īll serialization, interpolation and extrapolation, animation replication, etc, is handled automatically by Bolt. You can either hold off on importing them or delete the existing Bolt Asset before creating the new one with the same name. If you import those, be aware you may be asked in the Getting Started tutorials to create a Bolt Asset that already exists. In the package folder there are addons for Bolt you can import such as the samples. For instructions on upgrading Bolt: Upgrading.Īfter installing or upgrading Bolt, you should have a folder structure which looks something like this: This tutorial is intended to be followed using the DEBUG build of Bolt, for more information on the different builds see the Debug vs. You'll set up a couple of simple scenes with Bolt, and perform all basic tasks like spawning objects and replicating transforms.įor clarity and teaching purposes, code is favored over Bolt's built in automation and testing tools.
UNITY REALISTIC FPS PREFAB MULTIPLAYER TUTORIAL HOW TO
This tutorial teaches you how to create your first multiplayer game with Bolt.