From e99839de0a3ad32de2a63f5b4ac258fb96cd3865 Mon Sep 17 00:00:00 2001 From: in0finite Date: Tue, 30 Apr 2019 23:29:21 +0200 Subject: [PATCH] Fix sending submit button event --- .../Scripts/Behaviours/Ped/States/BaseAimMovementState.cs | 5 ++++- Assets/Scripts/Behaviours/Ped/States/BaseMovementState.cs | 5 ++++- Assets/Scripts/Behaviours/Ped/States/FlyState.cs | 5 ++++- Docs/Multiplayer.md | 8 ++++++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/Behaviours/Ped/States/BaseAimMovementState.cs b/Assets/Scripts/Behaviours/Ped/States/BaseAimMovementState.cs index 7aa718de..96eed24a 100644 --- a/Assets/Scripts/Behaviours/Ped/States/BaseAimMovementState.cs +++ b/Assets/Scripts/Behaviours/Ped/States/BaseAimMovementState.cs @@ -492,7 +492,10 @@ namespace SanAndreasUnity.Behaviours.Peds.States { // try to enter vehicle - m_ped.TryEnterVehicleInRange (); + if (m_isServer) + m_ped.TryEnterVehicleInRange (); + else + base.OnSubmitPressed(); } diff --git a/Assets/Scripts/Behaviours/Ped/States/BaseMovementState.cs b/Assets/Scripts/Behaviours/Ped/States/BaseMovementState.cs index f4773920..e332dae9 100644 --- a/Assets/Scripts/Behaviours/Ped/States/BaseMovementState.cs +++ b/Assets/Scripts/Behaviours/Ped/States/BaseMovementState.cs @@ -91,7 +91,10 @@ namespace SanAndreasUnity.Behaviours.Peds.States public override void OnSubmitPressed() { // try to enter vehicle - m_ped.TryEnterVehicleInRange (); + if (m_isServer) + m_ped.TryEnterVehicleInRange (); + else + base.OnSubmitPressed(); } diff --git a/Assets/Scripts/Behaviours/Ped/States/FlyState.cs b/Assets/Scripts/Behaviours/Ped/States/FlyState.cs index c4944056..6b66d719 100644 --- a/Assets/Scripts/Behaviours/Ped/States/FlyState.cs +++ b/Assets/Scripts/Behaviours/Ped/States/FlyState.cs @@ -35,7 +35,10 @@ namespace SanAndreasUnity.Behaviours.Peds.States public override void OnSubmitPressed () { - m_ped.TryEnterVehicleInRange (); + if (m_isServer) + m_ped.TryEnterVehicleInRange (); + else + base.OnSubmitPressed(); } public override void OnJumpPressed () diff --git a/Docs/Multiplayer.md b/Docs/Multiplayer.md index f0f3d3f6..aafcfe2d 100644 --- a/Docs/Multiplayer.md +++ b/Docs/Multiplayer.md @@ -8,9 +8,13 @@ - adapt states: -- send button input events to server: +- send button input events to server: submit, -- When ped enters vehicle, he changes parent. Is this allowed in Mirror ? Possible solution would be to only change parent of ped model. +- When ped enters vehicle, he changes parent. Is this allowed in Mirror ? Possible solution would be to only change parent of ped model. Also, while ped is in vehicle, network transform should not sync. + +- disable vehicle's rigid body on clients ; apply linear and angular velocity manually ? ; + +- sync car color - stats window