I am working on a pretty big map, so I am using teleporters to quickly and easily get to a certain portion for testing.
While stepping on one of the pads and teleporting to a build space with my character, I jumped on a swivel chair I made to test if it would spin. The teleporter pad (the one that I teleported to) then got triggered as If I stepped on it, when not even close to it. I had already walked away from it. As if it wasn’t strange enough, it also happens to other unanchored parts.
A solution I have tried is making sure that it wasn’t just another one of the millions of studio bugs by playing a real game instance and doing the same exact thing, and sure enough it happened again.
[Visual Aids]:
Glitch showing inactive to anchored part:
Glitch showing active to unanchored part (the same exact part):
I spawn in, touch the teleport pad to go to the other one and immediately touch the chair or the unanchored block after walking off the other teleporter.
I added a debounce in the code to prevent infinitely teleporting back and forth. But for some reason, the glitch isn’t reproducing in that specific game for me either. But when I tested in the real game map, it did.
I don’t really know what to say about it now, I just don’t want players being glitched by swords and other weapons in the game that use .Touched when they aren’t even close to them.
Your debounce +1.75 is set after your check to see if it’s >os.stamp. I think that’s why it’s printing multiple hits.
When you’re testing click on the part and chair to see if you have any other scripts that are causing the teleport. This may be due to something from a plugin you are using in your Studio, so it’s not causing the issue in the sample place.
Try putting in prints to give you more information about what’s going on. For example:
print("plr = ", plr.Name, " debounce = ", debounce[plr.Name], " stamp = ", stamp)
if not plr or (debounce[plr.Name] or 0) > stamp then return end
Well I didn’t intend on debouncing the print, the print is only there and added temporarily to show that the part is being touched without physically touching it.
That is the problem, the print is just to show that it’s being touched without even touching it physically. It’s still happening to me but something I cannot fix.
If I added the print & warn after the debounce is met, it wouldn’t show efficiently and undoubtedly that the part’s .Touched itself is being fired aside from the teleport function’s potential delays and etc. If you look closely in the video, you’ll see the hit2 being printed out only one time right when touching the chair or other unanchored part, which should not be happening. That shows in night/day contrast that the part is firing as touched when it shouldn’t be, as intended with my placement of the print/warn.
I think the problem is confusing because of my videos and explanation, but basically there is no other script in the game that teleports except for the teleporters. The chair is just a chair, and the unanchored part is just a part. They have no affiliation with the teleporters. They should not be firing a .Touched for the teleporter pad as they have nothing to do with them. The only other script in the test game is the script that aligns the position of the chair for it to be able to spin.