so i was using timelines for a leaning mechanic in my game and i came across a hurdle that involved timelines seemingly being directly tied to the framerate
(here is the code)
in that case this is very weird then, since the code i posted above executes way faster on higher frame rates than on lower ones, maybe there is somthing else i did wrong that ties this section to the framerate?
Yeah Im very aware that it’s spaghetti code and I’m real sorry you had to see that XD, I’m still learning unreal engine and this is my first game, I’m trying to make a leaning system similar to rainbow six siege where if u press one button it leans to one side press the other it unleans the current lean one and leans to the other side and on pressing lean on one side again it will unlean back to the idle position. This code currently works but the speed of the lean for some reason depends on the frame rate, which is the very baffling thing I came across. Thanks for your reply anyway I hope you have a great day
I’m not going to dissect this fully (your code looks way too complex for a lean), but it looks like you’re feeding the last result back in as input of your lerp. That may be the problem. When interpolating between two values, you interpolate from start to end, not current to end.
Also, you can access your timelines through a variable and play them that way; just type in the name of your timeline when adding a node, and it will give you the reference to the timeline.
And it looks like you have separate timelines for leaning & unleaning. Really, you only need one timeline: you play it to lean and reverse it to unlean, and make the output value positive or negative based on the side you want to lean to (positive is right, and negative is left).
thanks alot, that fixed it for me, you were exactly right, feeding in the current position makes the timelines perform differnetly when learping since the point A isnt fixed and keeps changing, feeding the rotation values into a rotator before lerping does the trick, thaks a lot again