Advertisement
Guest User

fhdfj

a guest
Feb 16th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1.  public override void ExecuteCommand(Command command, bool resetState)
  2.     {
  3.         PlayerCommand cmd = (PlayerCommand)command;
  4.  
  5.         if(resetState)
  6.         {
  7.             transform.position = cmd.Result.position;
  8.             movement = cmd.Result.velocity;
  9.         }
  10.         else
  11.         {
  12.             movement = new Vector3(cmd.Input.horizontal, 0, cmd.Input.vertical);
  13.             movement *= BoltNetwork.FrameDeltaTime;
  14.             movement *= 5; //Speed
  15.        
  16.             //controller.Move(movement);
  17.             transform.Translate(movement);
  18.  
  19.             cmd.Result.position = transform.position;
  20.             cmd.Result.velocity = movement;
  21.         }
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement