Interested in character "limb manipulation"

Hey, so I just wondered. But when ever I would desire to manipulate/animate or move a character’s limb, say for example, his torso. (but that’d be r15 rig, obviously) is there any way to do manipulation to the torso without having to create another fake torso and weld that to the real thing or something?

And my question is also valid for any of the other limbs as well. Especially the character’s arms, would it be possible to manipulate or animate his existing arms without creating fake ones?? What I mean by “manipulate” is basically like, making it point somewhere, or, I don’t know, do an animation of some kind.

Any information would be appreciated. Thanks!

You can manipulate the Transform property of the joints every Stepped.

1 Like

Thanks for the reply, Xio. That’s actually pretty interesting, if you had the time, do you think you could show me a simple example of how that might be done?

#LimbsNoob

game:GetService("RunService").Stepped:connect(function()
     game.Workspace.Player1.RightUpperArm.RightShoulder.Transform = CFrame.new(90,0,0)
end)

This would have Player1’s right arm to have a 90 degree offset from the animation that’s currently playing.

Excuse me if I’m not exactly correct, it’s been a while since I used transform.

4 Likes

Thanks Xio! This is really interesting. I’ll definitely go and experiment with this. c:

Well, I’ve been experimenting trying to see if I could whip up a system so the character’s arm points towards a brick, but unfortunately the rotation is way off. Any help on this would be greatly appreciated:

c.RightUpperArm.RightShoulder.Transform = CFrame.new(transform.p,workspace.point.CFrame.p)

Thanks!

What you did is you just gave it the direction vector, you didn’t calculate how much the arm needs to rotate to match that direction.

Odd, I can’t seem to find where I had done this before, and I can’t remember the exact calculations.

2 Likes

I see. You’ve given me something to think about, not sure if I’d be able to come up with an algorithm for it however. Thanks for the reply :slight_smile:

1 Like

Have you considered actually using animations?
Your post seems to blatantly say animation a few times but avoids using that system…

It’s possible to do dynamic movements with animations, but it may take a bit of experimenting to get the desired result.

Phantom Forces, for example, uses variations of an animation and calculates different weights based on player input. Then it just plays the animation and looks natural.

I believe it’s something similar to:

  • An animation of the hand pointing up
  • An animation of the hand pointing down
  • Manipulate the weight to interpolate between both animations, thus interpolating between positions

Not exactly sure what, or how much you want to “manipulate or animate,” but usually the animation system is left best for animations.

This isn’t to say you can’t just directly adjust the Motor6’s, which can be better in some scenarios, but if you’re going to do more complex things than pointing, it’d probably be easier to use animations.

Let us know what other solutions you come up with!

1 Like

What I did was make a base animation and simply throw a script ontop that lerps the Motor6Ds every renderstepped.

1 Like

You need to apply it on top of the current transform. Overwriting it will lock the motor in a particular configuration, this is not what you want.

Moreover, you’re applying a 90,0,0 position offset, rather than a rotation offset.

The line would be:

local motor = workspace.Player1.RightUpperArm.RightShoulder
motor.Transform = motor.Transform * CFrame.Angles(math.rad(90),0,0)

You would apply whatever rotation makes sense to apply, this one may not make sense, I haven’t tested what this actually makes your character look like.

5 Likes

Thanks for the replies, guys!

Well I mean, for starters I’m horrible at actually creating animation tracks. Another thing being, for example, if I wanted to point the player’s arm to a location (for example, if I were to make a FPS game, where the gun or arms follow the camera) I don’t think just making preset animations for that would work, so that’s why I was digging into this kind of system.

I’ll try your advice, Thomas, although my mathematical knowledge is failing me here…not sure if I’ll be able to configure it to work or not. I’m just not that sufficient with math in coding, as stated in a post I’ve made awhile back xd

Thanks again guys! Any further help making an algorithm would be great. (Assuming I’m unable to get it up and running, if I can get it working I’ll report back with it to help anyone who’s looking to do the same thing, and to also mark the thread as solved.)

EDIT: Just a quick note, but I tried changing my code to function as you recommended Thomas, however I noticed no difference in the arm rotating. I’m totally not doing this right…

Whoops, sorry, forgot about math.rad.

1 Like