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

How do you make a button that checks if an object is touching another?

Asked by 6 years ago

Hi. I posted on here a few hours ago, and was able to get a script to use. Now, I just need help making it for a button. I am currently using

 local function onTouch(hit)
    if (hit.Parent.Parent.Parent) then
        print(hit)
    script.Parent.Parent.B.AlignPosition.Enabled = true
    script.Parent.Parent.B.AlignOrientation.Enabled= true
    end
end

script.Parent.Touched:connect(onTouch)

I'm unsure how to make a button that checks if this is true, then run a script based on that. Any help is appreciated!

Answer this question