What do you want to achieve?
I am currently trying to make a retractable sword, similar to how work a light saber from star wars
What is the issue?
So basically it is a tool since it is a weapon for players. But the main problem is that the blade doesnt keep the right position, it is always displaced from the origin or where it should be which is above the handle.
What solutions have you tried so far?
I tried looking on google. I found one solution which is Part:Resize(Enum.NormalId.Right, 1) but it still resize on both side.
Also here is more details:
i tried using Resize function which failed. Also i used CFrame + size which made my char moving. Finally i tried modifying the position of the blade with the size of the blade but at the end, the blade is displaced from the origin. Anyone know how to do it?
I think that that is a bug (Resize method not working properly), cause I encountered that problem myself as well. Displacing the sword yourself should work though.
Oh I did not read that last part. It should still work in theory, since WeldConstraint only needs Part0 and Part1. Perhaps the sword part is just colliding with the handle? Can you try to turn the blade’s CanCollide off?
The WeldConstraint should not be a problem “If a welded part’s Position is updated, the part will move but none of the connected parts will move with it. The weld will recalculate the offset from the other part based on the part’s new position.” - Developer Hub.
It’s been a while since now and i found a solution. The solution is pretty simple when we know how to do use it:
i just need to use a Weld (not WeldConstraint) and weld the blade and the handle. Then, i use handle.Cframe:ToObjectSpace(CFRAME) and that’s all