Hello, just started learning roblox, moving from Unity (I study roblox as a hobby since I work on Unity). There I got used to a large number of features to control everything that happens.
Right now, in my project, I’m trying to rotate the animated hands of the player through Motor6D.
But the animation does not allow my Motor6D to indicate the desired degree of rotation.
Is it possible to somehow specify CFrame after the animation has done its calculations?
Idle animation video: robloxapp-20230109-0216162.wmv (1020.6 KB)
I have a character, I already made him turn his body without problems. Although this is very strange, I have animations where I animate the body, and in this case, the rotation works fine.
When I wanted to do the same with my hands (I did everything according to the lesson), this method did not work, although it should logically.
I experimented a lot, I thought it was because of the animator that Roblox provides. I wrote my own animator and concluded that everything is precisely because of the animation that is being played, because if the animator is turned off, the hands work.
Code
local neckC0 = CFrame.new(0, 0.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local waistC0 = CFrame.new(0, 0.2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local rShoulderC0 = CFrame.new(1, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local lShoulderC0 = CFrame.new(-1, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
function RotateParts(player, theta)
local neck = player.Character.Head.Neck;
local waist = player.Character.UpperTorso.Waist;
local rShoulder = player.Character.RightUpperArm.RightShoulder;
local lShoulder = player.Character.LeftUpperArm.LeftShoulder;
neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(theta*0.5, 0, 0);
waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(theta*0.5, 0, 0);
rShoulder.C0 = rShoulderC0 * CFrame.fromEulerAnglesYXZ((theta*0.5), 0, 0);
lShoulder.C0 = lShoulderC0 * CFrame.fromEulerAnglesYXZ((theta*0.5), 0, 0);
end
The code I use on the server to rotate player parts.
Thanks for the replies, and sorry for the bad English, I’m from Ukraine , so there might be some mistakes.