Hello all, I am trying to use the animation blueprint in Unreal Engine 5.5 to move the playuer’s hand IK based on the position of the mouse. Ideally, when the player clicks on the hand, it will not move until they drag it, and then it will move relative to the player’s mouse. When they let go, the hand will stop playing the animation and will go back to its default position.
I have achieved the same using a tutorial, but this only applies to moving static meshes and other SM’s bones without an animation BP.
I am struggling with the maths, and so currently, whenever I click the hand, it knows which socket / bone I am clicking, however, the hand offsets to the mouse position, and then follows the mouse at an offset.
Ideally, I would like it to not move until the mouse is dragged.
I will post some photos below of my working, in which:
-L hand origin is where the hand was at the time of clicking
-Relative Mouse L is calculated by the function (last image)
-Mouse Origin is where the mouse first was when clicking.
-The current locations are currently being updated in the tick event, I think.
If anyone has any idea, please, about what I can change / fix, It’d be hugely appreciated! I’m ironically not very savvy at maths and some help with theory would be very cool.
If you’re wondering about world space, I was under the belief that the nodes I use get and move the bone in world space, and that the mouse location is converted to a vector 3 also.
In this final image you can see that after clicking, the hand offsets. The prints on the left are the Relative mouse location (Yellow) and the current mouse location (Blue) and they slightly move because the player’s idle animation moves the mouse in world space.
HUGE thank you to any help in advance!