The hit detection of the moving cube is pushed a bit ahead of where its moving. I’d like it so it would detect parts that are visually touching it.
Script below is a child of the pink moving cube
while true do
local touchList = workspace:GetPartBoundsInBox(script.Parent.CFrame, script.Parent.Size)
for i, touchedPart in pairs(touchList) do
local player = Players:GetPlayerFromCharacter(touchedPart.Parent)
if not player then -- if it doesnt hit a player
continue -- end
end
if LocalGetter:Get(player, 'attributes', 'Deflect') then -- if the player is deflecting
-- LocalGetter is a custom module i made to get client sided objects/values
continue -- end
end
print('we hit a Player!!!!')
end
task.wait()
end
Thanks in advanced.