Ideas for animating gun to mouse position?

Im trying to make a system that animates the character to point its holding gun to the mouse position.

This is what i got for now:

  • The animation is a whole track that goes from left to right on its time length, and while the character is holding the gun, i keep setting AnimationTrack.TimePosition according to the pointing position relative to the character’s root part while its speed is set to zero through AnimationTrack:AdjustSpeed(0).

The problem is that this animation can only cover X axys direction.
As you see in the video, the character doesnt point up or down.
I cant figure out a way to make it work as easily to match also Y position and make it able to that.

I accept any kind of new approach to make this work as intended. Thanks!

1 Like