I would hazard a guess the second option would be the way of choice. And I think the scripting might not be all that hard even.
Taking a look at the animation class, I’d say AnimationState.time might be just what you want. You could have a value proportional to your aiming height, and set the ‘time’ of the animation to the corresponding point. Thus giving your character the desired angle of aiming.
You’d still have to take care of your blending/layers as to not inhibit any other animations taking place, but I recon you’ll figure that out.
Time in this case is that the frame of the animation or realtime? If not is there a way to run it by frames.
Was thinking of having an animation with one frame per * from top to bottom in say a 45* arc and just run it to the frame I need just like rotateing would work.
Trying to think of a way to make it simple to use for AI and human controled characters.
I think time here represents where on the clip the ‘playhead’ is. In ‘realtime’, not framewise.
Still this would be very usefull.
You would for instance make your character aim fully down (-35*) on the first frame, and fully up (+45*) on the last frame, let’s say the 80th frame (corresponding to your 80* action radius). Frames in between could be anything, from a simple linear interpolation, to a frame-by-frame perfect ‘animation’.
Now say you run this at 20 fps, this would mean your animation takes 4 seconds to complete. Ie “time = 0.0;” would make him point down at -35*. “time = 3.0;” would then be +25*, and so forth.
You’d have to check for the animation playback speed though; I don’t know what playback rate is ‘default’.