BoolValue states false when part is not touching another part

Screenshot 2023-06-23 021640

I have made a script where a part named “Glider” touches a part named “Detection”, it sets a BoolValue named “TouchedValue” to true. I managed to get that part working, but I’m having a difficult time where the BoolValue goes back to false when “Glider” is no longer touching “Detection”.

1 Like

From the code you provided it doesn’t seem like there is any logic that sets the value back to false after it’s been touched. Are you sure the value is ever set to true in the first place?

(Also, if the part is called “Glider”, I’m not sure why you’re checking if the parent of the hit part is Glider. Maybe changing it to if hit.Name == "Glider" then will fix it?)

Try debugging it by just putting a print("Touched") above touched.Value = true and see if it ever actually gets set to true.

Otherwise, it may be another script setting it to false.

maybe you should add an else line like thus:

else touched.Value = false

So basically, you want to set touched.Value to false when it stops touching the detector? You could use TouchEnded for that