I Am Working On A Game Where When Players Knock Into Each Other, They Are Pushed Back In The Opposite Direction The Torso Is Facing. I Have Written Some Code To Do This, But It Is Not Working As Intended,
local player = game.Players.LocalPlayer
local Body = script.Parent:WaitForChild("Torso")
local Humanoid = script.Parent:WaitForChild("Humanoid")
Humanoid.Touched:Connect(function(HitBody)
if HitBody.Name == "Torso" then
print("Launch")
Body.Velocity = Vector3.new(Body.Position.X / Body.Position.X * HitBody.Size.X * -1, 0, Body.Position.Z / Body.Position.Z * HitBody.Size.Z * -1)
end
end)

1 comment
Thank You So Much!