VectorForce doesn't seem to work

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)

just to make sure, was the attachment supposd to be in the rootpart?
(oh nevermind i just saw it)
althought why are you creating a new part? why dont you use the humanoidrootpart itself

is this local script? or server script?

did a bit of tampering and fixed it, forget about the post, atleast for now

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.