From 1a66200d7064a2f6cd9263bd8c73c153650a7666 Mon Sep 17 00:00:00 2001 From: in0finite Date: Fri, 12 Jul 2019 02:54:35 +0200 Subject: [PATCH] client uses 'loop' wrap mode for roll anim --- Assets/Scripts/Behaviours/Ped/States/RollState.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Behaviours/Ped/States/RollState.cs b/Assets/Scripts/Behaviours/Ped/States/RollState.cs index 0ec502db..5bb5c644 100644 --- a/Assets/Scripts/Behaviours/Ped/States/RollState.cs +++ b/Assets/Scripts/Behaviours/Ped/States/RollState.cs @@ -37,7 +37,10 @@ namespace SanAndreasUnity.Behaviours.Peds.States { base.OnBecameActive(); m_animState = m_model.PlayAnim( this.movementAnim ); - m_animState.wrapMode = WrapMode.Once; + // clients have wrap mode set to 'Loop', because state can be switched very fast between roll and crouchaim, and + // server will not update current state syncvar, so client will not start the state again, + // and roll state will remain + m_animState.wrapMode = m_isServer ? WrapMode.Once : WrapMode.Loop; m_model.VelocityAxis = 0; // movement will be done along x axis }