I am trying to find the position of the yellow balls collision but half of the time i doesnt detect collision outside of the player character or it only detects the collision from the zombie. I am not sure what may be causing the problem
the position of the collision is indicated by this white star:
for _, Point in pairs(Points) do
local Part = Instance.new("Part")
Part.Anchored = true
Part.CanCollide = false
Part.Size = Vector3.new(2,2,2)
Part.Color = Color3.fromRGB(255, 170, 0)
Part.Shape = Enum.PartType.Ball
Part.CFrame = CFrame.new(
Point
)
Part.Parent = workspace.SuperBallPoints
Part.Touched:Connect(function(hit)
if hit:IsA("Part") and not hit:IsDescendantOf(character) then
if hit.CanCollide == true and SparkHit == nil then
SparkHit = Part
workspace.SparkEffect.SparkPart.CFrame = Part.CFrame
Part.TouchEnded:Connect(function(hitEnd)
if hitEnd == hit then
SparkHit = nil
end
end)
end
end
end)
end