Commit e758579f authored by Ben W's avatar Ben W
Browse files

Fixed issue with client movement

parent d41897fb
......@@ -235,19 +235,15 @@ MonoBehaviour:
m_EditorClassIdentifier:
Prefab: {fileID: 5347128353891683361}
ClientAuth: 0
_sync: 1
Sync: 0
_threshold: 0.1
IsOwner: 0
OwnerID: 0
_networkThreashold: 0.01
_rotationThreashold: 1
_mouseSensitivity: 50
_cameraPivot: {fileID: 5347128354487130093}
_rigidbody: {fileID: 8160207462294650896}
_groundCheck: {fileID: 5347128352765724455}
_movementSpeed: 60
_lowJumpMultiplier: 20
_fallMultiplier: 2.5
_movementSpeed: 10
_jumpHeight: 20
--- !u!54 &8160207462294650896
Rigidbody:
......
......@@ -128,6 +128,9 @@ class NetworkedBehaviour : MonoBehaviour
private void UpdateTransform(DarkRiftReader reader)
{
if (ClientAuth && !NetworkManager.IsServer)
return;
_lastPosition = reader.ReadVector3();
_lastRotation = reader.ReadVector3();
......
......@@ -108,7 +108,8 @@ class PlayerManager : NetworkedBehaviour
private void MovePlayer()
{
_rigidbody.AddForce(_lastMovement.normalized * _movementSpeed, ForceMode.Acceleration);
_lastMovement.y = _rigidbody.velocity.y;
_rigidbody.velocity = _lastMovement * _movementSpeed;
}
private void Looking()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment