Bolt Events

How do I tell all the players that this piece of code worked?

In a photon cloud this is not a problem, I can use RPC, but I can not figure out how to do it in Bolt.
Variant where you need to use Bolt Entity does not suit me, I do not want to create a big load, creating a lot of Entity


//This method creates arrows

void ArrowFire(){
if (Timer <= 0) {
var Arrov = Instantiate(Arrow,ArrowPos.transform.position,ArrowPos.transform.rotation);
Arrov.GetComponent<Rigidbody>().AddForce(transform.forward* ForceScale);
Timer = Reload;
}
}

Comments

  • You can use a state trigger or entity event, and when called it will create a "fake projectile", see Bolt tutorial for example.
  • stanchion said:

    You can use a state trigger or entity event, and when called it will create a "fake projectile", see Bolt tutorial for example.

    Thanks for the help.
    I use bolt entity, and method BoltNetwork.Instantiate

    And when I create, I pass the transform in the Attached method

    public override void Attached ()
    {
    state.SetTransforms (state.ArrowTransform, transform);
    }

    This works very cool for the server, but the client somehow creates two arrows at once, one works normally, the other just falls under his feet


    //Fire method

    void ArrowFire(){
    if (Timer <= 0) {
    var Arrov = BoltNetwork.Instantiate (BoltPrefabs.Arrow, ArrowPos.transform.position,ArrowPos.transform.rotation);
    Arrov.GetComponent<Rigidbody>().AddForce(transform.forward* ForceScale);
    Timer = Reload

    }