Off track detection system for racing game

Hi dev forum users,

I need help figuring out how to script an off track detection system. I use parts that are on the track surface currently and the Zone+ module by foreverHD. I have found that with my cars the server lags quite a bit. I have tried to use the single use methods the module has however it wont work with more than one person in game.

Maybe I am using the module wrong but any alternatives would be great. If any examples are needed i will be happy to share them with you.

Thank you for your assistance.

Use raycast or fastcast

Zoneplus region3 and touched are way slower and are not even needed

How would i do this exactly? I am not familiar with how raycasts work but have been looking into learning them.

I’d recommend avoiding modules that aren’t needed. In this case, I would use either GetPartsInPart or preferably GetPartBoundsInBox. Also make sure to use a debounce or something related so that the the function only triggers once instead of constantly while inside the zone, and also only once per vehicle rather than for every part.

However, Touched and TouchEnded will also work if you use them appropriately.

1 Like

Ok thank you, I will look into these

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.