hi all! as much as i want to be very descriptive for clarity, i don’t want to be too specific as to what exactly i’m doing (for confidentiality), so i’ll describe everything as vaguely as i can while also being comprehensible (this is to hopefully explain any possible writing oddities and whatnot beforehand)
so basically, i’ve recently been working on a system that as its main purpose changes the size of a car’s wheels every frame on the client as long as a certain condition is met, this works perfectly fine and i have no issues with it.
however, the problem comes when the wheel size changing happens at the same time as a (client) touched event linked to the driver’s HumanoidRootPart is supposed to fire (once), when these two coincide, the event will instead fire every frame where the wheel size has changed and the player remains inside the part (size only changes while in motion), the big issue is that this Touched event adds to a leaderstat every time that it fires, so its functionality is basically ruined by the touch spamming - my question comes into play here: what could i do to potentially fix / find a workaround for this? so far i’ve only been able to think of running a spatial query every frame and replicating the functionality manually with more checks to prevent this from happening, but i don’t even know which one i’d use or even how i’d go about basically recreating the behavior using the new method, i don’t think theres much more i can mention regarding the issue without repeating myself or not providing anything of value
many thanks in advance to anyone who tries to help, i’m willing to answer questions the best i can if my crappy explanation wasn’t good enough !