https://i.gyazo.com/a184e8dba42b9346fee9fd0c4b6b35f6.mp4
When I use my sword it looks like this and I realised that I have to change the CFrame properties in this script to have an accurate position of the sword inside the hand. How do I find the CFrame properties so I can accurately place the sword on my hand? Thanks
Where it says grip = CFrame.new(0.1,0,-5.5) that’s the physical position of the sword in your hand.
Maybe you could set the grips cframe to the hands cframe. You get a parts cframe like this:
local part = (the part)
--this is if it's a tool and it's equipped
part.CFrame = script.Parent.Parent.RightHand.CFrame
Where it says * CFrame.Angles(math.rad(0), math.rad(180), math.rad(90)) those are the angles the sword is at in the X,Y,Z format.
After reviewing your code I think that it manually sets each parts cframe, however that’s an ineffecient way to do it. An easier way would be to weld all of the parts together group the and move the handle to your hand.
Yes, but this script also sheaths the sword, attaching it to the right leg. He may want to play with the “sheath =” numbers as well to fine tune it.
Well then wouldn’t you be able to just set the grips cframe onto the right leg as well? it’d be as easy as a variable.
Do I put the script in a part and run the game and the CFrame position be shown in the output bar? Sorry I don’t understand what to do.
If you wanted the sword’s position to match it exactly yes, but it’s not too often a mesh’s position and rotation will match exactly with the position of the Part you want to match it with.
I’m not sure where you want to run the script in the game since you didn’t say where you got it from and where it was placed originally.
Basically you need to play with the 3 numbers and 3 angles individually then run it again. Note what changed in the grip, then modify it until you are happy with it.
So there is no way to calculate the CFrame angle and position you want, you just keep changing the numbers manually until you get the result?
There may be a precise way to do it, but I’m not that good.
I’d start with the -5.5 value since the sword appears to be way down out of the way in one direction.
Thanks I got the sword position I wanted