You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/zone.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,34 @@ zone:relocate()
128
128
```
129
129
Moves the zone outside of workspace into a separate WorldModel within ReplicatedStorage or ServerStorage. This action is irreversible - once called it cannot be undone.
Tracks the item until it has entered the zone, then calls the given function. If the item is already within the zone, the given function is called right away.
Tracks the item until it has exited the zone, then calls the given function. If the item is already outside the zone, the given function is called right away.
On the client you may only wish to listen for the LocalPlayer (such as for an ambient system). To achieve this you would alternatively use the ``.localPlayer`` events.
45
46
46
47
!!! important
47
-
Zone group parts must remain within the workspace for zones to fully work
48
+
Initially zone parts should be located within Workspace to function properly. If you wish to move zones outside of Workspace (e.g. to prevent them interacting with other parts), consider using [zone:relocate()].
49
+
50
+
!!! important
51
+
Zone parts must belong to the 'Default' (0) collision group.
48
52
49
53
If you don't intend to frequently check for items entering and exiting a zone, you can utilise zone methods:
-- This updates _currentEnterDetection and _currentExitDetection right away to prevent nil comparisons
88
81
ZoneController.updateDetection(self)
@@ -344,10 +337,19 @@ function Zone:_update()
344
337
end
345
338
end
346
339
localpartProperties= {"Size", "Position"}
340
+
localfunctionverifyDefaultCollision(instance)
341
+
ifinstance.CollisionGroupId~=0then
342
+
error("Zone parts must belong to the 'Default' (0) CollisionGroup! Consider using zone:relocate() if you wish to move zones outside of workspace to prevent them interacting with other parts.")
0 commit comments