Making the player not glued to the floor during explosion

I’m making an explosion where it’ll fling the player by changing the HumanoidRootPart’s Velocity which seems to work great when the player is already in the air, but when the player is on the floor and gets hit by the explosion they only move about a centimeter. How would I go about fixing this?

Code:

local explosion = Instance.new("Explosion")
	explosion.Position = script.Parent.Position
	explosion.DestroyJointRadiusPercent = 0
	explosion.ExplosionType = Enum.ExplosionType.NoCraters
	explosion.BlastPressure = 500000;
	explosion.BlastRadius = 100
	explosion.Parent = script.Parent
	
	local hit_targets = {}
	explosion.Hit:Connect(function(part)
		if part.Parent:FindFirstChild("Humanoid") then
			local char_model = part.Parent
			if char_model and not hit_targets[char_model] then
				hit_targets[char_model] = true

				local directionVector = (char_model.HumanoidRootPart.CFrame.p - explosion.Position).unit
				local velocity = directionVector * 500
				
				char_model.HumanoidRootPart.Velocity = velocity
			end
		end
	end)

Video example:

1 Like

I’ve never had to do this type of system myself, but I’d recommend trying to change the Humanoid State

1 Like

I thought about this and setting the Humanoid’s state to Jumping so it gets them off the ground before it applies the velocity but it still has the same result

Solution: Used a LinearVelocity object instead of changing the root’s velocity

1 Like

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