Skip to content

Commit

Permalink
fix(Controls): prevent button anchor changing on enable
Browse files Browse the repository at this point in the history
The button anchor was continually changing based on the initial
constant force that had been added to the button which meant
every time a button was disabled and re-enabled the position of
the button would move slightly each time.

This fix allows the anchor to be auto configured the first time
but then after that it prevents it from be auto set so it stays
at the correct position.
  • Loading branch information
thestonefox committed Jul 14, 2017
1 parent 45d7ffe commit 915fa2f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Assets/VRTK/Scripts/Controls/3D/VRTK_Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ protected virtual void DetectJointSetup()
}

buttonJoint.connectedBody = (connectedTo != null ? connectedTo.GetComponent<Rigidbody>() : buttonJoint.connectedBody);
buttonJoint.autoConfigureConnectedAnchor = false;
}

protected virtual void DetectJointLimitsSetup()
Expand Down

0 comments on commit 915fa2f

Please sign in to comment.