Best way to achieve an IK bat swing?

Hey everyone, I’m trying to brainstorm the best way to accomplish something similar to this (built in Unity)

Obviously there is a simple solution of just have a bat swing solely animating the arms and then having the waist joint rotate to the mouse orientation, but I am curious if there would be any other ways (like mixing roblox animations + an IK target).

What steps should I take to achieve something similar to this?

The Animation Editor has an IK dragger, unless that isn’t what you’re searching for here.

I think this video is suggesting that all the arm movement is based off nodes that control where the arm’s hands should be. (correct me if I’m wrong). It isn’t too hard to program dynamic 2 joint inverse kinematics with the law of cosines. You could dynamically set the cframe of the bat and a cframe for the other arm and calculate the cframes of the arms using this math. Here’s an in depth link.

1 Like

Yeah that’s for making what I want to call “static” animations with a fixed goal in mind.
I want to be able to have a target/goal and be able to “swing” towards that. Watch the video and it should make it clearer what I’m saying

1 Like

Yeah, I guess. That just seems overkill if I want to do any modifications. It’d be nice if I could build something on-top of ROBLOX animations if it makes sense

if the ball is moving quickly, you could fake it and push it more towards where the bat is located when the animation for swinging is played so that it shows the player hitting the ball with the actual bat.

Or just push the player a bit more towards the ball itself.

1 Like

Can’t do that, as you’d be swinging at a player

If you’re using r15, you can just tilt the hip/uppertorso to face it towards the nearest player or if you’re using r6, face the torso or tilt the arm to face it towards the player when they swing the bat.

1 Like

That’s a hacky solution and one I don’t want to use.
I still want it to swing near a target even if there is no player he’s hitting