Hi there,
I’ve coded a door that operates on a hinge (PhysicsConstraintComponent).
After the door has swung open and consequently swung back to it’s initial rotation, I am unable to stop it’s rotation if the door is moving too fast.
The code is basically this
Tick()
{
Door_Rotation = Component->GetComponentRotation();
if ( Door_Rotation.Yaw == Initial_Rotation.Yaw )
{
Lock_Door_Rotation();
}
}
So basically I can stop the door if it’s moving fairly slow, but if it’s moving too fast it will swing past it’s initial rotation.
The door is a physics enabled component and I am using an angular impulse to apply an opening and close force on the door.
Thanks,
Braeden