I’m trying to achieve a shove system, part hits humanoid, vectorforce gets created and yippe yippie dummy gets pushed.
However, the force doesn’t seem to work at all, despite being in an attachment which is in a part which is in the rootpart, and the numbers of it being extremely high.
HumanoidRootPart is unanchored, so is any other bodypart.
There are no errors in the output which makes this more confusing
local Part = script.Parent
local shoveSound = Part.ShoveSound
local db = false
Part.Touched:Connect(function(hit)
if db == false then
db = true
if hit.Parent:FindFirstChild("Humanoid") then
shoveSound:Play()
local BasePart = Instance.new("Part")
BasePart.Parent = hit.Parent.HumanoidRootPart
BasePart.Anchored = true
BasePart.CFrame = hit.Parent.HumanoidRootPart.CFrame
BasePart.CanCollide = false
BasePart.Transparency = 1
local attachment = Instance.new("Attachment")
attachment.Parent = BasePart
attachment.CFrame = BasePart.CFrame
local force = Instance.new("VectorForce")
force.Parent = attachment
force.ApplyAtCenterOfMass = true
force.Force = Vector3.new(0, 20000, 50000)
end
task.wait(1)
db = false
end
end)