How to make arms rotate with mouse?

Hey all! Im trying to make a little thingy where the player’s character will tilt down to face the mouse’s position. To accomplish this, I am rotating the C0 of the joints so that they face in the right direction. While this works for the neck joint, I have found that it only kind of works with the shoulder joint.

834ca7f4af78739853607a3277e5925f

from a wild guess, it seems like there’s maybe some inverse kinematics action going on there, which wasnt present a few years ago when I last employed this method. What do people do nowadays, if this doesnt work anymore?

Edit: It’s kind of hard to tell from the image, but the left arm is rotating. It twists inward toward the torso, with the elbow joint rotating in the opposite direction in kind. As i am only manipulating one motor6d, it doesnt make sense for this to happen, which led me to believe that a roblox core script may be rotating the other joint to compensate. (again, these are all wild guesses, Im not super up to date on roblox character systems)

After some testing, this seems to be an issue specifically related to the arms. While the other joints can rotate freely, it seems that the arms are programmed to always point in the same direction no matter what:

59f9decb3eb4922d716fd3e3d4cbb3e7

I am now fairly certain that there is an inverse kinematics issue, and theyre probably a part of the animation rather than a part of the core scripts. I cant conceive of a way to fix this besides completely stripping all of the animations from the player’s avatar, which would invite a whole new host of problems. Is there no way around this? This is a massive added difficulty curve to programming things of this nature.

Can you disable the animations only during your mouse movements?

Considering the context of the problem, maybe. I dont know if there’d be any way to reenable them after the fact though. In any other case, this also wouldnt be a viable solution, as this would create a static, mannequin character that just floats around and follows the mouse.

I’ve found that the best solution here is to disable the shoulder joints and replace them with your own motor6ds. These new motor6ds are unaffected by this problem.

While this does technically work, it also overrides any animations affecting those joints. I havent found any good solution for this.

This is the best solution I have been able to come up with so far:

7be8a1595b37e922f352f15f9f705fb0 (1)
How it works:

  • A second model is made, copying over the necessary parts and linking them together. The positional offsets are saved (the copied pieces of the model are colored red in the gif). These pieces in the original model are made transparent

  • every frame update, the difference in CFrame is calculated between each part and the part its joined to (i.e. the CFrame difference between the left hand and lower left arm).

  • The motor6d of each piece of the copied model has these offsets overlaid onto them in the C0 field, mirroring the animation

  • The rotations are plugged into the C1 field of each joint, rotating them to point toward the mouse

Now, this method has some drawbacks:

  • This is resource intensive
  • changes to the player’s model (i.e. adding armor, morphs) will not be reflected onto the tilted model

What I want to know is what the heck did Roblox change that made it this much of a pain to implement this? Doing manipulating player joins definitely wasn’t this difficult a year ago

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.