-
Notifications
You must be signed in to change notification settings - Fork 189
CircleZone
Michael Afrin edited this page Aug 23, 2020
·
2 revisions
An CircleZone is created by invoking the CircleZone:Create()
method, and passing in a center, radius, and a table of options:
local CircleZone = CircleZone:Create(vector3(0.0, 0.0, 0.0), 3.0, {
name="circle_zone",
debugPoly=false,
})
Note: CircleZones are basically distance checks with PolyZone helpers on top. For all practical purposes, they cost the same performance to use. CircleZones technically are two zones in one: CircleZone and SphereZone. By using the useZ option, seen below, you can set whether or not your CircleZone ignores the Z coordinate.
Property | Type | Default | Required | Description |
---|---|---|---|---|
useZ | Boolean | false | false | If true, the CircleZone uses the Z coordinate. Otherwise it ignores it. You can think of this like having a Sphere, if true, and Circle, if false. |
debugColor | Table | {0, 255, 0} | false | Color of the zone |
getCenter()
setCenter(center)
- center must be a vector3 if useZ is true
getRadius()
setRadius(radius)
- radius must be a number
Note: Radius and center can be changed in real time with no performance loss