As you can see, I want to rotate that bridge on the Y axis when entering the trigger box, so that the player can move and skip the river. I’m using a timeline like this:
And my level blueprint looks like this:
The bridge initially has a 90 degrees rotation on the Y axis, so the first value I’m setting in the float curve is 90. If I rotate manually the bridge from the editor (with world transform) and put it in the proper way, the final rotation is 0. However, setting the last keyframe of the float curve to 0 makes the bridge rotate in the opposite way. That’s why I set it to 180. But, as you can see in the video, sometimes it gets the right rotation and sometimes not.
So I want to ask you 2 questions if possible:
How can I rotate the bridge properly with a timeline so I can get a smooth transition between those two points?
Why is that weird animation playing after I enter the triggerbox?
Your logic looks ok… but rotators can be a bit tricky because they hit +/- 180 and 360… the engine interprets the rotator, but sometimes it interprets it in a way that causes flipping. Its usually OK if you keep everything in rotators, but feeding in a float value to rotators can cause issues.
I’d use the 0 to 1 float variable on the timeline, and use RLerp between your two desired rotators
Pitch is a nightmare to use directly unfortunately. It was designed for FPS who never rotate beyond a 90 degree angle hence why pitch going from eye level up to the sky is +90, going from the sky back to eye level even if you would flip on your back to do so will always return a positive pitch between 0 and 90. Looking from eye level towards the ground will always return a value between 0 and -90. For this particular case, I would suggest as above to use a timeline with a float between 0 and 1 and plug this value into the alpha channel of a RLerp. You can even hard code in your values since it is a bridge and will only ever exist in 2 states, up or down. So your first value would be (0, 90, 0) and the second value (0, 0 ,0). You can then use the “reverse” timeline pin to pull the draw bridge back up.
Thank you both for help, I really appreciate it. I did just the way you two told me and it works Getting actor rotation for the two other axis triggered the same effect I was getting, so I just hard coded the initial and the final rotation in the 3 axis and voilà