Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to trigger touch event when its between 2 iddle anchored parts?

Asked by 6 years ago

One scenario is:

Scripting a punch, making it so when a plr clicks "q" i spawn in front of him an invisible box (representing the hit-box) that will destroy anything it touchs. When Spawning the box i do clone, anchored = true, parent = workspace, cframe = ... Then i want it to be able to detect anything that is touching the box and destroy it.

Problem: The touch event isnt triggered bec neither the box nor other parts are moving bec they are things like walls and stuff anchored.

How to solve this?

0
Use raycasting for the punch hellmatic 1523 — 6y
0
Raycasting is just one line, i need it to be space Kiriyato 15 — 6y
0
Try a Region3 MadWorlds 84 — 6y
0
Region3 has 2 problems i belive: first is it can only work as a cube, and second is you cant rotate the "cube" region, it consideres a cube according to world coordinates Kiriyato 15 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
part = script.Parent
part.Touched:Connect(function()
    if part:FindFirstChild("Humanoid") then
        -- Code Here
    end
    if not part:FindFirstChild("Humanoid") then break
end)
0
I haven't been on this site in a while, so I could be rusty. But that should be right if you don't want to detect those anchored parts. DeceptiveCaster 3761 — 6y
0
Not asking how to use the touch event.. But thx for the effort Kiriyato 15 — 6y
Ad

Answer this question