sm.areaTrigger.createSphere
Creates a new sphere area trigger at a given position with a given size.
Kind: Function
Environments: Game
Game
sm.areaTrigger.createSphere(
radius,
position,
rotation,
filter,
userdata,
world,
areaTriggerProxyType
)
If a filter is specified, the trigger area will only be able to detects objects of that certain type. See sm.areaTrigger.filter for more information about filters.
Parameters:
| Name | Type | Description |
|---|---|---|
radius |
number | The radius of the sphere. |
position |
Vec3 | The world position. |
rotation (optional) |
Quat | The world rotation. (Defaults to sm.quat.identity) |
filter (optional) |
integer | The object types the area trigger may detect. (See sm.areaTrigger.filter). (Defaults to sm.areaTrigger.filter.all) |
userdata (optional) |
table | An optional table of user data |
world (optional) |
World | The world to create the area trigger in. (optional) |
areaTriggerProxyType (optional) |
integer | The proxy type of the area trigger. (See sm.areaTrigger.areaTriggerProxyType) (Defaults to sm.areaTrigger.areaTriggerProxyType.default) |
Returns:
| Type | Description |
|---|---|
| AreaTrigger | The created area trigger. |