Events are Bolt's way of setting up a RPC-like call over the network.

Global events can be both Reliable and Unreliable by passing in different parameters to the Create method. In general most global events will be Reliable and that is also the default if you don't pass in anything to change it. Global events are intended for things that exist around the game like dealing with authentication or handling stuff like player inventories, etc.

Entity events are always Unreliable, they are intended for small one-off effects like showing a damage indicator or maybe playing an explosion, things that are ephemeral and if one player misses it it doesn't matter.

Calling A Global Event

    var evnt = ChangeDoorState.Create(Bolt.GlobalTargets.Everyone);  
    evnt.isOpen = b;  

Back To Top

Calling An Entity Event (entity Events Are Unreliable):

    var casingEvnt = SpawnCasing.Create(entity);
    casingEvnt.cPosition = weaponStatsScript.caseEjectionPoint.position;
    casingEvnt.gunRef = correctIndex;

Back To Top

Receiving An Event:

Make sure your script inherits from either:


Bolt.EntityEventListener / Bolt.EntityEventListener

(Note: These inherit from Bolt.EntityBehaviour already)

Then, to receive an event:

    public override void OnEvent (ChangeDoorState evnt)
        if(evnt.isOpen == true)

To Document Top