I'm using Maximum_ADHD's Character Realism system in my game, which includes a feature to rotate the player character's arm when they are holding a tool. However, whenever I destroy the tool equipped by them, the arm stays stuck as if it was still equipping a tool, and doesn't go back down. I have tried to make a functionality to reset the Motor6D, but nothing seems to work.
Here is the if statement block that checks for this:
-- HACK: Make the arms rotate with a tool.
if name:sub(-4) == " Arm" or name:sub(-8) == "UpperArm" then
local tool = character:FindFirstChildOfClass("Tool")
if tool and not CollectionService:HasTag(tool, "NoArmRotation") then
if name:sub(1, 5) == "Right" and rootPart:GetRootPart() ~= rootPart then
fPitch = pitch * 1.3
fYaw = yaw * 1.3
else
fYaw = yaw * .8
end
end
end
Again, I have tried to do else statements to change the Motor6D back, but it doesn't seem to work at all.