Hello,
So, I put two doors on two separate walls.
When I SetActorRotation(), the rotation seems to be set in the global axes, making the door on the left open past 90 degrees.
So, I tried this:
AActor* Owner = GetOwner();
FRotator NewRotation = Owner->K2_GetActorRotation().Add(0.0f, 0.5f, 0.0f);
NewRotation.Clamp();
Owner->SetActorRotation(NewRotation);
Got both doors to rotate from their initial positions but am unable to stop them.
I think I can use clamp() but not sure how, although I suppose I can use an if statement to stop the rotation (still doesn’t solve the door on the left because it will stop at the given global angle and also there may be a smarter way to do all this).
Maybe the following lectures will address this issue.
EDIT: I feel stupid
UPROPERTY(EditAnywhere)
float OpenAngle = 90.0f;
UPROPERTY(EditAnywhere)
float CloseAngle = 90.0f;