I’m working on a soccer ball game. While I was testing, I noticed that when players jump on the ball, they get flung by the ball. Here is a video showing the behavior:
I was wondering if there is any way to make it so the ball will never significantly move the player, the player should always have a higher priority than the ball, the ball should be moved by the player, not the player moved by the ball. (if that’s the best way to explain it)
Below is my character physics script if needed:
local IGNORE_LIST = {"Head", "HumanoidRootPart", "Torso"}
local character = script.Parent
local head = character:WaitForChild("Head")
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local torso = character:WaitForChild("Torso")
local function onDescendantAdded(descendant)
if descendant:IsA("BasePart") then
if table.find(IGNORE_LIST, descendant.Name) then
return
end
descendant.CollisionGroup = "IgnoreBall"
descendant.CanCollide = false
descendant.CustomPhysicalProperties = PhysicalProperties.new(0.7, 0, 0, 0, 0)
end
end
task.spawn(function()
while task.wait(2) do
for _, descendant in character:GetDescendants() do
onDescendantAdded(descendant)
end
head.CustomPhysicalProperties = PhysicalProperties.new(0.7, 0.5, 0.1, 1, 3)
humanoidRootPart.CollisionGroup = "IgnoreBall"
humanoidRootPart.CustomPhysicalProperties = PhysicalProperties.new(100, 0.5, 0, 1, 100)
torso.CustomPhysicalProperties = PhysicalProperties.new(100, 0.5, 0, 1, 100)
end
end)
character.DescendantAdded:Connect(onDescendantAdded)
Here are also the properties of the ball:
(Note: I know this might not be possible, because I still want to make the ball actually collidable with the character, but I was wondering if there is any fix to this at all)