Weld constraint doesn't work

Hello

Im having an issue with the weld constraint feature not working
I did everything well like anchored only the hinge, the weld constraint is active, both parts are in the same orientation but it still do not works

here’s a video of what i get (the hinge is the grey part rotating at 00:09 secs)

i cant tell what you are trying to do with this part, but couldnt you just use tween service or smth

Make sure that the parts are unanchored, and if they are being changed using position use CFrame instead ( WeldConstraint | Documentation - Roblox Creator Hub )

trying to rotate the black bridge using a hinge so tweening only the bridge would not work

and if they are being changed using position use CFrame instead

On top of that, changing/tweening part Rotation (which looks like what is happening on the video) will also not affect the part.

You have to tween/adjust CFrame for the WeldConstraint to work.

The part disapears using CFrame.Angle

You have probably constructed CFrame.Angles without the position component. Therefore your part was repositioned at 0,0,0.

Rather than constructing new CFrame from scratch, you should multiply current CFrame by required rotation - or use CFrame.UpVector

Example code

Hinge.CFrame = Hinge.CFrame * CFrame.Angles(math.rad(90),0,0)

UpVector version:

Hinge.CFrame = CFrame.LookAt(Hinge.Position, Hinge.Position + Hinge.CFrame.LookVector)

Thank you its working this time but its not rotating in the good way
People told me to use Vector3 instead of CFrame for this kind of issues but since i cant use it for this situation what do i have to do ?

CFrame rotations are something you will have to get used to unfortunately.

Try experimenting with different values in CFrame.Angles. You can put math.rad(90) in either of 3 places and/or add a minus sign: math.rad(-90).

One of those 6 versions will be correct one. Proper one will depend on the part initial orientation.

it works perfectly fine thank you for your time

1 Like

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