|
@@ -16,7 +16,12 @@ Common use cases are to set the health or speed of a specific enemy AI, the tint
|
|
|
|
|
|
## Defining a script property
|
|
|
|
|
|
-Script properties are added to a script component by defining them with the `go.property()` special function. The function has to be used at the top level---outside any callback-functions like `init()` and `update()`. The default value provided for the property governs the type of the property: number, boolean, hash, `msg.url`, `vmath.vector3`, `vmath.vector4`, `vmath.quaternion` and `resource` (see below).
|
|
|
+Script properties are added to a script component by defining them with the `go.property()` special function. The function has to be used at the top level---outside any lifecycle functions like `init()` and `update()`. The default value provided for the property governs the type of the property: `number`, `boolean`, `hash`, `msg.url`, `vmath.vector3`, `vmath.vector4`, `vmath.quaternion` and `resource` (see below).
|
|
|
+
|
|
|
+::: important
|
|
|
+Note that the reversal of the hash value works only in the Debug build to facilitate debugging. In the Release build, the reversed string value does not exist, so using `tostring()` on a `hash` value to extract the string from it is meaningless.
|
|
|
+:::
|
|
|
+
|
|
|
|
|
|
```lua
|
|
|
-- can.script
|