I’m trying to make a system that will detect when a car hits a corner cut brick. It seems like a very straightforward system but the .Touched event doesn’t seem to be working right and I have been struggling with this for days, so I figured I’d post something here, make sure it’s actually a bug and not just an oversight by me, and then maybe create a topic in #bug-reports:engine-bugs.
The interesting thing is that I can actually drag & drop the racecar from the server onto the checkpoint, and it will register and say “touch detected”. This leads me to believe that this is some issue with network ownership and not my code.
Here is an example of what happens when I drive into a corner cut (mind you, the corner cut bricks are server only and do not exist on the client): https://streamable.com/dg88v0
Notice how the part count from :GetTouchingParts() is changing, but the actual touched event is not firing.
Just a heads up, .Touched on the server is very vulnerable to exploiters. Which would basically mean exploiters could abuse any code that the .Touched event is responsible for.
Also you might wanna move the :GetChildren() outside of the for loop for performance reasons.
But why it’s not firing the .Touched event is quite odd.
So you’re saying that the client can invoke .Touched on the server?
This would be in line with my findings as well because when I replicate a copy of the corner cuts folder to the client, it ends up working exactly as expected. I don’t think I’ll need to worry about the .Touched being invoked as long as they can’t prevent it from being invoked (the checkpoints themselves use a much different detection system).
That’s a bold lie, exploiters can really do nothing to the touched event like run exploits through it and get admin or whatever
It’s a touch event, it detects if a part touches it. You could add a whitelist of part names. You can’t just run “game.touchevent = hacker wow” and get access to Server