Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

Allowing Client To Increase Speed

$
0
0
Have added sprint to the player controller in the sample directory of bolt. Works great on server player, however client gets throttled to normal walking speed. Specifically, movementSpeed in PlayerMotor is not changing on the clients, however it does on the server player.
Here is some example code of what I'm doing~
public override void ExecuteCommand(Bolt.Command c, bool resetState) {
if (state.Dead) {return;}
if (cmd.Input.sprint) {Sprint();}
}
And here is the Sprint method~
public void Sprint() {
if (entity.isOwner){
_motor.movingSpeed = _motor.runSpeed;
_motor.SetSpeed();
Debug.LogError("isOwner=True Sprint()" + entity.name);
}
}
What is interesting is that Sprint() fires for both the server player and client player, however client playerMotor speed will not change.
Also have tried implementing Sprint under SimulateController() method, however this only affected the server player.
Any suggestions or pointers appreciated!

Viewing all articles
Browse latest Browse all 15755

Latest Images

Trending Articles



Latest Images