Welding to LeftHand

What do you want to achieve? I want to weld a part to the players left hand, and give it an orientation for it to look correctly, but when I attempt this I am faced with some errors.

What is the issue? On the Properties its called “Orientation” and “Position”

But when I’m scripting, its changed to “Rotation” and “Position”.

Wouldn’t it be easier to keep the names the same and to not make things confusing for people? Or am I just completely missing something here?

And to divert back to my main issue, this is the error I’m receiving:

What solutions have you tried so far? I’ve tired different variations of code, and looked on dev-forum.

Any assistance will help out here like fr.

Okay so C1 is a CFrame value, this means it holds a position and a rotation

You can’t assign rotation like how you did above, you have to use CFrame.Angles

Weld.C1 = Weld.C1 * CFrame.Angles(val,val,val)

Alright, could you please explain each part of this? (Am new to welding parts rn and got no clue what CFrame.Angles is).

Well CFrame.Angles isn’t just for welding parts; it’s used when you want to rotate any sort of CFrame value

All it does is tell the code hey I want to rotate this CFrame by whatever value is inside of those arguments

You should also know that CFrame.Angles takes in something called radians; basically a unit of angle that tells the function how much to rotate it by, so you’ll need to use the math.rad function to convert degrees to radians

Alright so Say in my example i want to rotate the welded part and move the position a little, How would that look?

I’m guessing you’d want to move it in local space not world space; but thats something morre complicated that I dont think you quite need right now so

So Im rotating it 90 degrees on the Y axis and then im moving it up 10 studs in world space

Weld.C1 = Weld.C1 * CFrame.Angles(0,math.rad(90),0) + Vector3.new(0,10,0)
1 Like

Alright it got it working but in the script the X orientation is 90 but in game it sets to -90. How can i fix this?

Edit: I could try to experiment until i find a working angle

EDIT 2: Got it working by flipping it around so the script says -90. Got no clue why Roblox works like this but it works

1 Like

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