Wave wont detect touching objects while being tweened

  1. What do you want to achieve? Keep it simple and clear!
    A wave that can destroy objects by chance and make them collapse
  2. What is the issue? Include screenshots / videos if possible!
    I am trying to make it detect objects that are not locked.

script:
if script.Parent.Parent == workspace then local TweenService = game:GetService("TweenService") local ev_tweeninfo = TweenInfo.new( 1, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0 ) function evaporate(part) local b = TweenService:Create(part, ev_tweeninfo, {Transparency = 1}) b.Completed:Connect(function() part:Destroy() end) end local tsunami = script.Parent local hitbox = script.Parent.hitbox hitbox.Touched:Connect(function(hit) print(hit) print("hit something unlocked") if hit.Locked == false then hit.Anchored = false local a = math.random(1,20) if a == 1 then evaporate(hit) end end end) end

Is your wave anchored? It looks like it might be. Anchored parts don’t fire a .Touched event on other anchored parts, as their physics is disabled, and Touched is calculated using the physics engine.

You can call GetTouchingParts in a loop though, to get a list of each part the wave will be touching at that point in time.

1 Like