Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I change the arm position with CFrame?

script.Parent.d.ClickDetector.MouseClick:Connect(function(player)
	local humanoid = player.Character.Humanoid
	if humanoid then
		local armweld = player.Character.Torso:FindFirstChild("Left Shoulder")
		armweld.C0 = armweld.C0.CFrame.fromEulerAnglesXYZ(0, 0, 90)
	end
end)

It works but it keeps giving me weird/broken positions. I am trying to make it seem like I am holding A tool.

2 comments

0

Don't repost problems. To properly format your code, click the blue Lua icon which will insert two lines of "~~~~". Then place your code in between these two lines.

0

I only reposted because I couldn't find my first post even when I clicked "mine"

1 answer

✓ Accepted answer

You have made one error in your script, C0 is already a CFrame value so you don't have to do...

armweld.C0.CFrame

Also another thing you should have done is just added from the current CFrame that you had to work with so it should've be something like this...

armweld.C0 = armweld.C0 * CFrame.fromEulerAnglesXYZ(0, 0, 90)
-- if you wanted to add position you should add another * cframe like this
armweld.C0 = armweld.C0 * CFrame.fromEulerAnglesXYZ(0, 0, 90) * CFrame.new(0,0,0) --whatever you want

Yet another thing!!!!!! When using CFrame Angles, the Angles work in some other different kind of rotation system so you should make it so it does it in radians, this will make it so you can use the normal rotation system. This is how it should be done

armweld.C0 = armweld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(90)) * CFrame.new(0,0,0)

If this helped please accept my answer! ~tantec

10 comments

0

scriptinghelpers this script block thing isnt working!

0

nevermind :')

0

The arms go all the way below the baseplate.

0

It seems like the position was changed not the angle

0

Nvm I got it to work

0

pls accept answer ;c

0

no stop being greedy

0

wow you have 5414, its very ironic coming from you :(

0

Accepted

0

yay thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.