Skip to content

Commit

Permalink
Emotes bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SDraw committed Nov 5, 2022
1 parent b7d1078 commit 15a750c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ml_amt/MotionTweaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public void OnSetupAvatar()

void OnIKPreUpdate()
{
bool l_overrided = false;
bool l_legsOverride = false;

m_ikWeight = m_vrIk.solver.IKPositionWeight;
m_locomotionWeight = m_vrIk.solver.locomotion.weight;
Expand All @@ -327,23 +327,25 @@ void OnIKPreUpdate()
if((m_ikOverrideCrouch && (m_poseState != PoseState.Standing)) || (m_ikOverrideProne && (m_poseState == PoseState.Proning)))
{
m_vrIk.solver.locomotion.weight = 0f;
l_overrided = true;
l_legsOverride = true;
}
if(m_ikOverrideFly && MovementSystem.Instance.flying)
{
m_vrIk.solver.locomotion.weight = 0f;
l_overrided = true;
l_legsOverride = true;
}
}

// But not this
if(m_ikOverrideJump && !m_grounded && !MovementSystem.Instance.flying)
{
m_vrIk.solver.locomotion.weight = 0f;
l_overrided = true;
l_legsOverride = true;
}

if(l_overrided && m_followHips && !m_moving && PlayerSetup.Instance._inVr)
bool l_solverActive = !Mathf.Approximately(m_vrIk.solver.IKPositionWeight, 0f);

if(l_legsOverride && l_solverActive && m_followHips && !m_moving && PlayerSetup.Instance._inVr)
PlayerSetup.Instance._avatar.transform.localPosition = m_hipsToPlayer;
}

Expand Down

0 comments on commit 15a750c

Please sign in to comment.