Hi!
I’m making an open world game and I need to be able to detect when a player leaves and enters a position, so I can add Indy there color correction, ei: clear sky’s in the field, green fog in the swamp, but I’m not sure how to detect when the entered and when the left
.Touched events don’t work well, because I need to detect when they enter and leave the location
If I were in your position I would use:
Just personal preference though.
2 Likes
This looks like it would work great! I’ll make sure to try it when I get the time
So simply an example:
--this is in my server script service
local Zone = require(ServerStorage.Zone) --Zone v2 module location
local zoneGroup1 = game.Workspace.map.Locations.Folder1 -- I am not sure why I set it to a folder I suggest looking at documentation, but within the folder I have a singular part for detection, a block covering the section of space I want to detect
--A model could work as well I think, experiment
local zone1 = Zone.new(zoneGroup1) -- determine it as a Zone within zone module.
zone1.playerEntered:Connect(function(player)
--whatever u want when player enters the area
end)
zone1.playerExited:Connect(function(player)
--whatever u want when player leaves the area
end)
Just an example, theres more functions associated with the module but I have not needed to delve any further than this for my own use.