Hello.
I’m attempting to make a clean sheath with my katana. However, the katana looks extremely strange when I run the animation to sheathe it.
Here are my scripts:
Event.OnServerEvent:Connect(function(Player, Action)
local Character = Player.Character
local Hum = Character.Humanoid
if Action == "Equipped" then
local equipAnim
equipAnim = Hum.Animator:LoadAnimation(game.ReplicatedStorage.Unsheathe)
equipAnim:Play()
equipAnim:GetMarkerReachedSignal("Sword"):Connect(function()
local Sword = Character:FindFirstChild("Katana")
if Sword then
local SideWeld = Sword:FindFirstChild("SideWeld")
if SideWeld then
SideWeld:Destroy()
local Weld = Instance.new("ManualWeld", Sword)
Weld.Name = "HandWeld"
Weld.Part0 = Sword.PrimaryPart
Weld.Part1 = Character:FindFirstChild("RHand")
Weld.C0 = Weld.Part0.CFrame:ToObjectSpace(Weld.Part1.CFrame)
end
end
end)
end
if Action == "Unequipped" then
local Sword = Character:FindFirstChild("Katana")
local unequipAnim
unequipAnim = Hum.Animator:LoadAnimation(game.ReplicatedStorage.Sheathe)
local Weld = Sword:FindFirstChild("HandWeld")
unequipAnim:Play()
unequipAnim:GetMarkerReachedSignal("Teleport"):Connect(function()
if Sword then
if Weld then
Weld:Destroy()
local SideWeld = Instance.new("ManualWeld", Sword)
SideWeld.Name = "SideWeld"
local Case = Character:FindFirstChild("Case")
SideWeld.Part0 = Sword.PrimaryPart
SideWeld.Part1 = Case.Case.Sheath.Base
SideWeld.C0 = CFrame.new(2.865,0,.18)
Event:FireClient(Player)
end
end
end)
end
end)
That was the script that runs the animation and equips/unequips the sword.
Where did I go wrong?