Skip to content

Commit 915fa2f

Browse files
committed
fix(Controls): prevent button anchor changing on enable
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.
1 parent 45d7ffe commit 915fa2f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Assets/VRTK/Scripts/Controls/3D/VRTK_Button.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ protected virtual void DetectJointSetup()
194194
}
195195

196196
buttonJoint.connectedBody = (connectedTo != null ? connectedTo.GetComponent<Rigidbody>() : buttonJoint.connectedBody);
197+
buttonJoint.autoConfigureConnectedAnchor = false;
197198
}
198199

199200
protected virtual void DetectJointLimitsSetup()

0 commit comments

Comments
 (0)