I’m trying to make a tower crane, using a physics constraint on the winch to make it swing.
I would like to control the length of the wire, lifting or lowering the cargo.
The problem:
While the shackle is simulating physics it cannot be moved.
Disabling and then re-enabling simulate physics doesn’t seem to work.
Found the solution, thankfully in time for deadlines.
Never would’ve guessed, but using the physics grab component gets the desired behavior.
Steps to reproduce:
• Set simulate physics to enabled on the winch’s latch. Optional: increase linear and angular damping for nicer movement (mine is set to 0.2 on both).
• Use the physics grab component to grab the winch’s latch on begin play, with grab location set to the start/pivot of the winch.
• On tick, set the physics grab component target location to the point in world space where latch would be if it was standing still (winch start/pivot plus the winch extension, which you should store as a float variable).
The winch extension variable can then be changed on some input, and that should achieve the desired result.