Hello! I have found this bug where my box that is welded to my hrp is uhh having some collision problems, when i press any movement key on the wall, two or three times, it just clips through the wall
https://gyazo.com/6749649f91e2a32005a8605c176bfc3f
the box was’t supossed to go through the wall
script:
local player = game.Players.LocalPlayer
local hrp = script.Parent.HumanoidRootPart
local humanoid = script.Parent.Humanoid
local Holding_WalkAnim = humanoid:LoadAnimation(workspace.walk)
local UIS = game:GetService("UserInputService")
local rs = game:GetService("RunService")
local mouse = player:GetMouse()
local torso = script.Parent.Torso
local isBoxWeldSpawned = false
rs.Heartbeat:Connect(function()
wait()
if mouse.Target and mouse.Target:FindFirstChild("Pickable") then
local CD = mouse.Target.ClickDetector
local Box = mouse.Target
CD.MouseClick:Connect(function()
if isBoxWeldSpawned == false then
isBoxWeldSpawned = true
weldRightArm = Instance.new("WeldConstraint")
weldRightArm.Name = "RightArmWeld"
Box.CFrame = hrp.CFrame * CFrame.new(0,0,-1.70)
weldRightArm.Part0 = torso
weldRightArm.Part1 = Box
weldRightArm.Parent = script.Parent
Holding_WalkAnim:Play()
end
end)
end
end)
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
weldRightArm.Parent = nil
Holding_WalkAnim:Stop()
isBoxWeldSpawned = false
end
end)