I’ve been making a magic fighting game and I’ve been trying to add some sort of knock back to the attacks, i just cant seem to be able to apply any force on the player
i tried adding vector force or linear velocity to no success
sample code:
body.Touched:Connect(function(Hit)
if Hit:IsA(“Part”) or Hit:IsA(“MeshPart”) then
if Hit.Parent.Name ~= player.Name then
local EHumanoid = Hit.Parent:FindFirstChild(“Humanoid”)
if EHumanoid then
if disabled == false then
disabled = true
EHumanoid:TakeDamage(30)
local velocity = Instance.new(“VectorForce”)
velocity.Parent = EHumanoid.Parent.HumanoidRootPart
velocity.Force = Vector3.new(0,1000,0)
velocity.RelativeTo = Enum.ActuatorRelativeTo.World
end
end
end
end
end)
on a sidenote i tried using applyimpulse on client, to no effect
body.Touched:Connect(function(Hit)
if Hit:IsA("Part") or Hit:IsA("MeshPart") then
if Hit.Parent.Name ~= player.Name then
local EHumanoid = Hit.Parent:FindFirstChild("Humanoid")
if EHumanoid then
if disabled == false then
disabled = true
EHumanoid:TakeDamage(30)
EHumanoid.Parent.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(0,1000,0)
end
end
end
end
end)
Try setting your game to R6 mode then just use “Torso”, i’ve had issues with R15 in the past because some avatar packages dont have certain torso parts, or have too many
this is a snippet of code, there is disabled up there further also ive found a workaround, ive simply used apply impulse. i just didnt notice at first when i used it because turns out my avatar is commically heavy