I'm trying to get a part to spin on a weapon/armor that is welded to the character when the player equips it. Sort of as a decoration bit.
Using part.Rotation will rotate the part based a world rotation, not a local rotation to the part. See image how the shoulder looks fine but the shield isn't when the player turns. https://gyazo.com/dcd6496a00ce12a11c05ced587ac6c32
This is the script that is in the floating part inside the model.
part = script.Parent
a = 0
while wait(.03) do
part.Rotation = Vector3.new (a, 0, 0) -- x, y, z
--part.CFrame = part.CFrame * CFrame.fromEulerAnglesXYZ(0,.01,0)
a = a+3
end
Tried using CFrame, but then the floating part no longer rotates and it just rotates the character as if it was anchored in the air. So much worse.
Also tried BodyAngularVelocity inside the part, which allows the player to move freely, but causes the player to constantly rotate. https://gyazo.com/c4ec6831c138db269731f8f01951dae1
I'm assuming this is not something that can be done with scripting and would have to be animated? Not sure how to animate parts in roblox. Animating in Maya is pretty simple though, Roblox doesn't allow animating just parts?.
Thanks

3 comments
have you tried CFrame:PointToObjectSpace () ? it converts world space to object space, but I dont know how exactely. There are 2 CFraming pages on dev wiki
You can use LookVector of the CFrame too, making it look to an invisible part welded to the shield
or looking at the shield plus some rotation if needed.