24-03-2026, 05:23 PM
*facepalm* WaitForFixedUpdate is obvious now haha
To get consistent results with no jumping I actually had to wait for multiple update frames after the fixedupdate frame. Might be overkill that i can tweak later but for now it works - thanks!
To get consistent results with no jumping I actually had to wait for multiple update frames after the fixedupdate frame. Might be overkill that i can tweak later but for now it works - thanks!
Code:
private IEnumerator SetupRopeNextFrame(Transform startTarget, bool isStartDynamicAttachment, Transform endTarget, bool isEndDynamicAttachment)
{
while(!rope.isLoaded)
{
yield return new WaitForFixedUpdate();
}
resetRopeLength();
Debug.Log($"trying to connect to start transform: {startTarget}");
connectToBothTargets(startTarget, isStartDynamicAttachment, endTarget, isEndDynamicAttachment);
_ropeIsActive = true;
yield return new WaitForFixedUpdate();
yield return null;
yield return null;
ropeRenderer.enabled = true;
}