Now I have a box collision in place and I have some ideas how to go about this. But every solution I came up with seems to be too complex. I wonder what is the easiest way to make the door rotate when Player is in the box collision.
Rotation slowly starting on BeginOverlap, then continuous rotation during overlap and then rotation slowly stops after a delay of 2 s after EndOverlap.
My biggest question probably is how to go about creating the continuous rotation in between the slow start and slow end.
So for anyone interested here is how I made it in the end. I think a lot of stuff is probably redundant but maybe it’s ok. I am kind of abusing the fact, that the door model is exactly the same in 0 and 90 degrees, so after it rotates 90 degrees I just push it back. It could be made to rotate the entire length of 360 degrees for everything to be absolutely correct but then the lag before it can actually play the End rotation animation would be too long.
I also use “Get Playback Position” for the actual animation so that’s why timelines don’t have anything set up. For the start and end I also use Ease function Sinusoidal In and Sinusoidal Out respectively.
Important part is the branching after overlaps that makes sure that everything is not played again if the player decides to move back and front and back and front near the trigger box thus firing multiple overlap events if this is not taken care of. The delay of 2 before End overlap makes sure that the animation gets to the middle timeline - the “90 degree loop” because that’s the timeline which “45 degree” end can come after.
Also interesting may be using “Get Timeline Length” together with “Get Playback Position” to determine how many seconds are left for the animation to end, then using these seconds for a Retriggerable Delay (maybe could be just Delay?) and afterwards using Sequence to do 2 things at once - Stop the “90 degree loop” timeline" and starting the “45 degree end” timeline.
45 degree start - length 2, not looping
90 degree loop - length 2.5, looping
45 degree end - length 2, not looping
I hope the rest is self explanatory. If you have any questions, feel free to ask.
Edit: There’s a little issue with the rotation. 0 and 90 degrees are the same rotation basically, so it is necessary to finetune the timelines to not repeat one degree twice and go from 0-89 and 0-44. It is barely visible but there’s no reason not so solve it.