Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best way to disable then reenable rope?
#4
*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!

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;
    }
Reply


Messages In This Thread
RE: Best way to disable then reenable rope? - by Bopter - 24-03-2026, 05:23 PM