I'm moving my character controller using Euler integration like this:
Vector3 originalPos = transform.position;
Vector3 acceleration = Physics.gravity;
velocity += acceleration * Time.deltaTime;
characterController.Move(velocity * Time.deltaTime);
This works consistently on different framerates. I also implemented simple rope physics by pulling the controller back when its outside the radius. I then (on the same frame) calculate the new velocity from the new and old positions.
if (outsideOfRadius)
Vector3 newPos = anchorPos + (transform.position - anchorPos).normalized * ropeRadius;
Vector3 oldPosition = transform.position;
characterController.Move(newPos - oldPosition);
velocity = (newPos - originalPos) / Time.deltaTime;
}
This is the problematic part because it behaves significantly different on different framerates. This causes problems when my character controller lets go of the rope and tries to land on a platform. The distance covered on 30 fps is less than on say 60 fps or higher.
Is there a way I could make this work more consistently across different framerates?