public void FixedUpdate() { if (PhotonEngine.Instance.IsServer) { _networkInterface.RequestClientInputs(); UpdateInputs(); _networkInterface.SendServerTransform(); } else { _networkInterface.RequestServerTransform(); UpdateTransform(); if (_networkInterface.IsLocalPeer) { GetPlayerInputs(); } _networkInterface.SendClientInputs(_powerInput, _turnInput, _isJumping); } _hoverMotor.Move(_powerInput, _turnInput); if (_isJumping) { _hoverMotor.Jump(); } }
public void FixedUpdate() { GetPlayerInputs(); _hoverMotor.Move(_powerInput, _turnInput); if (_isJumping) { _hoverMotor.Jump(); } }
private void FixedUpdate() { float powerInput = Input.GetAxis("Vertical"); float turnInput = Input.GetAxis("Horizontal"); HoverCar.Move(powerInput, turnInput); if (Input.GetButtonDown("Jump")) { HoverCar.Jump(); } }