PUN Classic (v1.x) and Bolt are outdated and will not receive further updates. Of course, existing PUN Classic and Bolt projects will continue to run. New projects should use Fusion or Quantum.

IEntityReplicationFilter

IEntityReplicationFilter lets you determine whether the entity should replicate to the specific connection.

C#

public class EnemyController : Bolt.EntityEventListener<IEnemyTest>, Bolt.IEntityReplicationFilter
{
    /**
     * Filters out any package to be 
     * sent to a target connection
     * @param  connection Target player connection
     * @return            True if the target connection should 
     *                    receive updates from this entity
     */
    public bool AllowReplicationTo(BoltConnection connection)
    {
        return (myDistance < 1000f);
    }
}
Back to top