Depends, the goal is to offset the start time of an animation.
Theres many ways to achieve the same result with and without C++.
The end goal is to say “10 degree start, is at .2s, so play from .2s onwards”.
You can even just map the animation’s timing to a known convention and avoid conditional math…
1s starting animation, covering 0 to 180 rotation.
The math of where to start will always be 1/180 * angle to start at.
Perhaps, for something this simple you can just go with that. No need to murky stuff up with c++ and such.
I think what I might do is that I’ll use some conditional math, with the goal being to end on a certain frame because essentially both the cover idle animation and the start of the cover turn animations are practically the same, if I reach a certain frame on the turning animations, I’ll just reset the enum and that should reset to the default pose and blend into it (basically your idea of taking the curve and comparing it to a hard value). I also actually swapped the cover turning animations because once I attempted to rotate the root bone using my curve the animation became wonky so I just retargeted Mixamo’s cover turning animation directly to UE5’s mannequin.
Something’s odd, so the animation doesn’t play correctly when using the default anim blueprint that comes with the top down template. I made a different anim blueprint with no other states and blend poses by enum to see if it works and the animation actually plays correctly there. Unless the problem really is I didn’t create the state machine like you said and that’s causing the wonkiness.
How would you do that, you can’t use the rotate root bone node on the event graph nor the actual anim graph itself.
While that would make sense I set the anim curve to be from 0 - 360, start to end of animation, so I’m grabbing the rotation from the normal of the trace which I think should give it back to me in degrees and not radians.
Well, it’s been a while, been busy unfortunately and had issues and forgot to reply to this thread (sorry about that), so I ended up modifying to a solution based on what you said which ended up working as well for me, with the turning. I know the box trace works but I was trying to do another thing for fun so I thought I’d just combine both systems. I decided to scrap turning animations entirely since it’s unnecessary or leaning against the wall or that kind of thing.
Definitely not perfect and I’m sure there’s a bunch of edge cases but I ended up going with that, looks wonky to a certain degree.
But basically you were talking about finding the sides of the triangle and then getting the acute angle from that so that’s basically what I was trying to do here.
I also ended up being curious on making dynamic splines so I just combined it with turning a corner while wall hugging. These are just exercises I like doing and I’m trying to strengthen my logic. Anyways though, MostHost_LA, thanks for helping me back in 2022.