Hello. I’ve been recently running into a problem where using scripted ClickDetectors will sometimes decide to not function with no error given. This randomly happens with one or both buttons, and I’m not sure why. If anyone could tell me why this is or what I’m doing wrong, please let me know. Any help is appreciated. Thank you.
Attached below is an example of one button working but the other idling, as well as what the code is trying to do.
Alright, is this not the full code? Cause all that can be seen here is the set to 0 for Button1 then Button2 getting set to 25. If the other suggestion above doesn’t work out, it would be helpful if there was more context.
Ah! Well you shouldn’t be defining debounce globally. There should be a new debounce value for each of the click detector functions. Whenever you’re dealing with multiple functions they should never share a debounce value, they should all have their own because they’re clicked at different times if that makes sense.
Two separate local variables for the click detectors debounces. So underneath each function you should locally define debounce as false, not globally on line 7 like you are right now.
Alright so a friend of mine helped with the solution, turns out it was a collision issue with the button, which is weird because at times it would work but at other times it wouldn’t…
Regardless, I appreciate all of the help and support from you both. It really means a bunch. Farewell.