So I wanted to try to create a door that rotates in one direction. Basically, if I could assign its angle and then the door would rotate to that angle. I also wanted there to be another door attached to the end of the first door that behaves in the same way, except it’d rotate to a different degree that I’d set to an additional constraint or something.
A better visual for what exactly I’m trying to make is the moving closet door from FNaF 4.
I feel like this can easily be done by using constraints, but I haven’t had much luck.
You mean like a bifold closet door? The door(s) are hinged and stationary at one end, the two doors are hinged at the middle joint, and the end of the second door slides in a track that moves in a straight line?
I haven’t tried it, but here are a couple ways I’d attempt it:
1
Put a HingeConstraint at the attached (stationary) with the ActuatorType set to None.
Put a HingeConstraint at the inner folding edge of the 2 doors, with the ActuatorType set to Servo, and have this as the driving force, with the TargetAngle set to 0 for closed, and 175 for open (or maybe -175, depending on how you built it).
Have a PrismaticConstraint set up to slide the end of the assembly back and forth in a straight line so it doesn’t go “off track”.
2
Put a HingeConstraint at the attached (stationary) end with the ActuatorType set to Servo.
Put a HingeConstraint at the inner corner of the 2 doors, with the ActuatorType set to Servo with it’s AngularSpeed set to twice the AngularSpeed of the first HingeConstraint.
With the opening script set the TargetAngle of the first hinge to 87.5 and the second hinge to 175. To close the door set both TargetAngles to 0.