Hey there I have a small issue I don’t really understand. So I am using a skill that grabs the enemy and welds them and at the end of a certain velocity it’s suppose to launch them with a velocity as well. But the issue is that it works perfectly fine on enemy players but not on dummies. If you preview the video you will see what I mean. Basically the dummy is being grabbed properly but the launch velocity is not being applied and also at the end I try to knock over the enemy and you can see that it’s acting weird by the dummy just falling (like if he is ragdolled).
Video Example : Watch 2024-05-02 11-24-33 | Streamable
This is the logic code
local VelocityLogic = {}
local HitboxSkillModule = require(game:GetService("ReplicatedStorage"):WaitForChild("Modules"):WaitForChild("HitboxSkillModule"))
local Lifetime = 3
function VelocityLogic:ForwardVelocity(Char, speed)
local character = Char
if not character then return end
local hrp = character:FindFirstChild("HumanoidRootPart")
if not hrp then return end
local bodyVelocity = hrp:FindFirstChild("ForwardMomentum") or Instance.new("BodyVelocity")
bodyVelocity.Name = "ForwardMomentum"
bodyVelocity.MaxForce = Vector3.new(math.huge, 0, math.huge)
bodyVelocity.Velocity = hrp.CFrame.LookVector * speed
bodyVelocity.Parent = hrp
local runService = game:GetService("RunService")
local connection = runService.Heartbeat:Connect(function()
if hrp and hrp.Parent then
bodyVelocity.Velocity = hrp.CFrame.LookVector * speed
end
end)
local manager = HitboxSkillModule.new(character)
manager:CreateHitbox({
Size = Vector3.new(10, 10, 10),
Color = Color3.new(1, 0, 0),
Transparency = 1,
Distance = 0,
Character = character
}, Lifetime, function(humanoid, hitPart)
humanoid:TakeDamage(10)
local enemyHrp = hitPart.Parent:FindFirstChild("HumanoidRootPart")
if enemyHrp then
enemyHrp.CFrame = hrp.CFrame * CFrame.new(0, 0, -5)
local weld = Instance.new("WeldConstraint")
weld.Part0 = hrp
weld.Part1 = enemyHrp
weld.Parent = hrp
enemyHrp.Massless = true
hitPart.Parent.Humanoid.PlatformStand = true
task.delay(Lifetime, function()
weld:Destroy()
enemyHrp.Massless = false
hitPart.Parent.Humanoid.PlatformStand = false
local launchVelocity = Instance.new("BodyVelocity")
launchVelocity.Velocity = hrp.CFrame.LookVector * 100
launchVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
launchVelocity.Parent = enemyHrp
task.delay(0.5, function()
launchVelocity:Destroy()
end)
end)
end
end)
local function stopVelocity()
if connection then
connection:Disconnect()
end
if bodyVelocity then
bodyVelocity:Destroy()
end
end
task.delay(Lifetime, stopVelocity)
return stopVelocity
end
return VelocityLogic