CREATE YOUR WORLD
Scripting

Property

5min
check out the properties exposed by zepetoscript a property is a component setting and option that can be edited in the inspector using properties, you can manage the state and data of gameobjects or other components, and control access from outside zepetoscript is based on typescript as the programming language, consequently the following syntax is used for property declaration property accessmodifier propertyname propertytype; ex) public playernumber float; private playerlocation vector3; properties declared this way are visible in the inspector, where you can assign values or objects to them the values you assign will later be initialized at runtime properties import { zepetoscriptbehaviour } from 'zepeto script'; import { vector3, gameobject, transform } from 'unityengine'; export default class properties extends zepetoscriptbehaviour { public floatvalue float; public strvalue string; public gameobj gameobject; public transformvalue transform; public vectorvalue vector3; } to access the properties from within the zepetoscript use this property name import { zepetoscriptbehaviour } from 'zepeto script'; import { vector3, gameobject, transform } from 'unityengine'; export default class properties extends zepetoscriptbehaviour { public floatvalue float; public strvalue string; public gameobj gameobject; public transformvalue transform; public vectorvalue vector3; start() { console log(`floatvalue ${this floatvalue}`); console log(`strvalue ${this strvalue}`); } update() { // rotate cube a const transform = this gameobj getcomponent\<transform>(); transform rotate(this vectorvalue); // rotate cube b this transformvalue rotate(this vectorvalue); } } when using multiple properties, declare them in an array in zepetoscript properties are shown in an array in the inspector, where you can input data for different elements typescript public floatvalues float\[]; if you declare an attribute in the script, you can control the property on the inspector property import { zepetoscriptbehaviour } from 'zepeto script'; import { transform } from 'unityengine'; export default class attribute extends zepetoscriptbehaviour { // public property that does not need to be serialized @nonserialized() public strvalue string; // property that should not be exposed on the inspector @hideininspector() public strvalue2 string; // private property that needs to be serialized @serializefield() private strvalue3 string; // addition of header above property @header("header title") public stringproperty string; // addition of spaces between property @space(10) public numberproperty number; // addition of tooltip that appears when the mouse is positioned on the property @tooltip("this is tooltip") public transformproperty transform; start() { } } below is an example screen when the attribute is applied for available attributes in zepetoscript, please refer to the following guide 📘 please refer to the following guide \[ list of unity functions available at zepeto world docid\ kcb1ttepmho um6 dv6oa ]