PUN Classic (v1), PUN 2 and Bolt are in maintenance mode. We will support Unity 2022 with PUN 2, but no new features will be added. Of course all your PUN & Bolt projects will continue to work and run with the known performance in the future. For any upcoming or new projects: please switch to Photon Fusion or Quantum.

대안이 되는 SimulateController / ExecuteCommand

Bolt 내에서 Executecommand "남용"

일반적으로 FPS 또는 TPS의 신뢰성있는 클라이언트-측 예측 이동의 유형을 수행하기 위해서 ExecuteCommand() & SimulateController() 를 사용합니다. 이것은 기본적으로 "resetState" 를 무시하고 "도착" 대상으로 사용할 수 있습니다.

    public override void SimulateController() {
    IMyVehicleCommandInput input = MyVehicleCommand.Create();

    input.Throttle = ...
    input.Gear = ...
    input.Blah = ...;

    entity.QueueInput(input);

    }

    MyVehicleCommand serverResult;

    public override void ExecuteCommand(Bolt.Command command, bool resetState) {
        MyVehicleCommand cmd = (MyVehicleCommand)command;

        // resetState means we got a state update from the server, this will only be true on the client
        if (resetState) {
            serverResult = cmd;
        }

        if (serverResult != null) {
            // if we have a server result, this is the last "verified" 
            // result from the server, the data will be available in 
            // cmd.Result and is specified by you on the Command asset.
            // this is your lerp target
        }


            // perform movement logic for player, this code execute on both client (controlling) and server
    }
}

기술문서 TOP으로 돌아가기