Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Register a function to be called when a game object gets destroyed. |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
bind(functionName, gameObject); |
Parameters
Parameter | Type | Mandatory | Description | Game version |
---|---|---|---|---|
functionName | String | The name of the function that should be called immediately before the gameObject is destroyed. | 3.1 Beta 1 | |
gameObject | Game objects | Any game object, such as a droid, structure or feature. | 3.1 Beta 1 |
Return value
Value | Type | Description | Game version |
---|---|---|---|
undefined | Undefined | Indicates the bind was successful. | 3.1 Beta 1 |
<error> | Error | Indicates there was a problem (did you remember to specify functionName as as a string?) | 3.1 Beta 1 |
Notes
To detect when your own objects are destroyed, use eventDestroyed() instead.
This function is useful because you can use it on objects owned by other players, and even destroyable features like trees.
Your function will be triggered immediately before the game object is removed from the map.
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
function certainDeath(gameObject) { // do stuff } bind("certainDeath", someObject); // where someObject is any Game Object |
Div | ||
---|---|---|
| ||
Removed in Warzone 3.2. |
Div | |||||||
---|---|---|---|---|---|---|---|
| |||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|