Pulley Puzzle
Thesis
– Basic setup
– Objects attached to both ends of a rope
– Rope hangs over something
– Setting Up First Basic Instance
– Ropes
– these are very touchy in HFF
– they usually use a setup where there is a start and end transform position, and several
rope segments get instantiated between these two points to produce a “soft body” object
– need to make sure neither of these points is deeply within another rigid body object,
or physical interacting object as this can lead to a constant state of colliding
– constant colliding causes the rope system to act erratically on its own
– Attaching a Physics object to both ends of a rope
– the original rope objects use a physics object at one end, and a fully fixed positional
object at the other end
– we need both ends to use a physics object
– This is done by:
– Making sure both objects are rigid body objects
– In the Rope script:
– Make sure to assign “Start Body” as one object, and “End Body” as the
other object
– Using “Copy_YellowMetalMechMediumCradledPlatform2” as other physics object
– this prefab initially has a hinge joint attached to it
– there is something about this that fixes the entire platform in place
– removing this allowed it to work as intended
– I dragged the reference of this main object in as the “Connected Body” for the Fixed Joint
component on the RopeStart gameObject in the pulley setup
– Issues
– I was using “Copy_YellowMetalMechSmallWinchSpool1” as the central wheel for the pulley setup, but sometimes the rope would break through it
– Appeared that such massive objects can cause the rope to clip through this sometimes
– I alleviated this by having the rope go over two winch spools (similar to the setup found
in the Demolition level)
– this also broke through one of them eventually while I was increasing the mass of the ball in Play mode to see if I could raise the platform
– Constructing “Create Pulley” script
– Needs:
– Rope
– Physics object at each end
– Total: 2
– Pulley wheel object
– Total: >= 1
– Parameters (words)
– Rope
– Length
– Start Point
– End point
– Physics objects attached
– Type of objects
– Mass
– Start point
– End point
– Wheels
– Quantity
– Position
– Important Relationships:
– Wheel(s) must start below the rope
– Must be on a similar plane, but lower on Y position
– End position must be “length” away from start position
– Length = End Position – Start Position
– This can be done with using Random.OnUnitSphere to pick a random
direction in 3D space