Note: I have to use R15 (sadly)
So, I have this cool script for a spleef game that worksn’t. It works if a player is only standing on it, but as soon as the player keeps jumping on it, it doesn’t register a hit. I did some research and apparently it’s because for some reason when a player jumps it doesn’t register as actually touching the floor. My friend suggested to use an invisible part above the original one to register the hit correctly, but I really don’t wanna go through the trouble of editing around 1.2k spleef tiles to make it work. He also suggested to use a ray on every spleef part. Here’s the thing: I have no idea how much of a toll it will take on performance (because I haven’t used rays too much) and I also don’t know if there are any better and less laggy options. Are there any other ways? Or is using rays on every one of the 1.2k not too laggy? I wouldn’t like to spent my time on something that I might find useless, lol.
Help appreciated.
Current script if needed for some reason;
function HexagonHoneyComb:AddLogic()
local connections = {}
for _, hexagon in ipairs(self.hexagons) do -- ipairs is faster by 0.0000008s so we'll use ipairs :troll:
connections[hexagon] = hexagon.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildOfClass("Humanoid") then
connections[hexagon]:Disconnect()
if not hexagon:GetAttribute("InstantFall") then
local tween = TweenService:Create(hexagon, TransparencyInfo, TweenGoal)
tween:Play()
tween.Completed:Wait()
end
hexagon:Destroy() -- Usually, you won't ever need the part again, so removing it from workspace is the best
end
end)
end
end