Possible Bug with networked character foot effects

Zaddo

Active member
In CharacterFootEffects.cs FixedUpdate, I think the Physics.Raycast should have a "!" in front of it, like code below. The Physics.Raycast will return true if the character is grounded. The original code will not implement the foot effects because it will exit the method when the Physics.Raycast is true.

C#:
        /// <summary>
        /// Detect the footstep.
        /// </summary>
        private void FixedUpdate()
        {
            if (m_FootstepMode == FootstepPlacementMode.None) {
                return;
            }

#if ULTIMATE_CHARACTER_CONTROLLER_MULTIPLAYER
            if (m_NetworkInfo != null && !m_NetworkInfo.IsLocalPlayer()) {
                // The transform interpolator will set CanPlaceFootstep for remote clients. This will indicate if the character moved.
                // The character should also be grounded.
                if (!m_CanPlaceFootstep || !Physics.Raycast(m_Transform.position, -m_Transform.up, (m_CharacterLocomotion.SkinWidth + m_CharacterLocomotion.ColliderSpacing), m_CharacterLayerManager.SolidObjectLayers, QueryTriggerInteraction.Ignore)) {
                    return;
                }
                m_CanPlaceFootstep = false;
            } else {
#endif
                // The character has to be grounded and moving in order to be able to place footsteps.
                if (!m_CharacterLocomotion.Grounded || !m_CharacterLocomotion.Moving) {
                    return;
                }
#if ULTIMATE_CHARACTER_CONTROLLER_MULTIPLAYER
            }
#endif
 
Last edited:
Top