Hi, I am thinking on making a zone/region system for my Cop game.
Something like liberty city.
I just don’t know what should I use, maybe .Touched and parts?
Region3?
I would use region 3, you can easily track which zone the player is in.
If you use the touched event, you wouldn’t be able to change stuff like music, effects, gui, etc… (For example a dusty effect in a desert biome with wild west music, transitions to a snowy biome with a blizzard.)
Hmm, yeah, but, since player might move in cars, It might be laggy?
Like detecting all parts in a region.
I know FindPartsInRegion3WithWhiteList
But it might be laggy since it has to detect all descendants to find if any of them is parent of the table whitelist
FindPartsInRegion3WithWhiteList should work.
You would still be able to find a player’s region using region3, correct? Why would you want to detect any other part rather than the character’s?
Yes, I know, but I mean, the engine, or function has to check if the part is in the whitelist, wouldn’t that be laggy?
No I don’t think so, all the code is doing is looking through the parts in the region and checking for a part in the whitelist.
It is simply only looking for the parts in the the array in which you want to whitelist. Any other parts will not be detected, so you don’t have to worry about the function looping over every single part in the game.
I hope that cleared up some confusion