Can't set hingeJoint.useLimits at runtime

I have a very simple ragdoll like character setup. I’d like the limbs to start off in a locked position. On keypress they should be able to be moved, and on key release they should be locked again in whatever position they’re currently in.

Setting hingeJoint.useLimits during runtime I can see that it triggers in the inspector, but the joints remain locked. However this works as expected if Use Limits is set to false from the inspector before entering play mode. Starting the scene with Use Limits set to false and then triggering via script in start or a delayed coroutine does not solve the issue → it seems like the limbs need a few frames to “catch on”. Any ideas? Thanks!

For anyone else who may stumble onto this, I ended up utilizing a part of the hinge joint I’d always ignored: the spring.

	void ActivateLimits()
	{
		JointSpring spring = this.hingeJoint.spring;
		spring.spring = 10.0f;
		spring.targetPosition = this.hingeJoint.angle;
		hingeJoint.spring = spring;
	}

	void DeactivateLimits()
	{
		JointSpring spring = this.hingeJoint.spring;
		spring.spring = 0.0f;
		hingeJoint.spring = spring;
	}