I am trying to create a theme park ride which can be controlled by the player.
Currently the arms rotate and the ride cart is suspended between the arms at one end. This works correctly and it swings like expected. The bit I am having a problem with is I want to be able to “pause” the physics so that the cart could remain upside down. Whenever I try to do this the cart will snap back to its original location relative to the RotationReference (components shown bellow).
To freeze the rotation I have tried disabling physics which freezes the cart in place until I reenable the physics. I have also tried locking the twist rotation of the physics constraint but that locks the cart in place but snaps it to its original location relative to the small cube, not relative to its current rotation.
Unless you meant something else, if you wish to change one of those dynamically, you can do so by calling its corresponding node from the ‘Physics Constraint’ component variable.
Could you not promote the twist limit to a variable and adjust this dynamically to “lock” the ride in place (at any given rotation) rather than actually altering physics? Perhaps with a ‘FInterp’ from 180 to -15 degrees. I don’t know what angles you’re actually using, so you’d have to find the correct numbers.
Or else, you could set the appropriate rotation dynamically along with the button press for altering physics states. Essentially, set the component to the opposite rotation of the up vector (if up is up) of the arms holding it–also with a ‘FInterp’ for a smooth transition. See options below: