Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to rotate the player's arm without animations (Motor 6Ds)?

Asked by 3 years ago

I need to rotate the player's right arm to get an effect similar to the animation that plays when you equip a tool. I can't use an animation for this since I ran out of animation priorities. I have tried using the code below, but it doesn't do anything.

Player.Character.RightUpperArm.RightShoulder.Transform = Player.Character.RightUpperArm.RightShoulder.Transform * CFrame.Angles(math.rad(90), 0, 0)

1 answer

Log in to vote
1
Answered by 3 years ago

Motor6D's

What is a Motor6D?

They are essential for building blocks of the Character, they have a C0, and a C1, Coordinate 0, and Coordinate 1.

We can rotate these, meaning we can rotate the players body parts without any animation.

Programming

It's simple if you already know about CFrame's but I'll show the code, I'll use the neck as an example.

Just insert a Local Script in StarterCharacterScripts.

local Character = script.Parent

local Neck = Character:WaitForChild("Head").Neck

local C0 = Neck.C0
local C1 = Neck.C1

if C0 and C1 then
       C0.CFrame = C0.CFrame * CFrame.Angles(0, math.rad(45), 0)

end

Conclusion

I hope you learned a bit about Motor6D's, i don't use them that much, but they're good to know about. : - )

If there are any questions please comment, i would be glad to respond and answer.

Ad

Answer this question