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

OnTouched script logic and bypass help?

Asked by 9 years ago

Normally I would use something like this:

function Touched(hit)
    if hit.Anchored == true then    
        script.Parent.Parent.Parent.Hull.Front.Value = true
        print("ANCHORED front")
    end
end

function TouchEnd()
    script.Parent.Parent.Parent.Hull.Front.Value = false
    print("not anchored front")
end

script.Parent.Touched:connect(Touched)
script.Parent.TouchEnded:connect(TouchEnd)

But this only detects when any brick TOUCHES its face. Is there anyway to alter this script into saying "if it detects a anchored brick within the 5 studded bricks volume, turn front.value to true" not just the surface?

1 answer

Log in to vote
0
Answered by
Nrav 0
9 years ago

A good idea is to make a transparent block surrounding it out from 5 studs on each side that connects to the brick. Do you know what I mean?

0
Thats exactly what I did, but it only calculates when it touches its FACE not its volume. I want the bool to be true when a anchored part is in that bricks volume. Orlando777 315 — 9y
0
Try using a blockmesh maybe Nrav 0 — 9y
Ad

Answer this question