A set of universal blocks that work with resizing Varwin objects. You can adjust the size of the object both in the 3D scene editing mode and in the Blockly logic editor

Inspector

In the scene settings, in the inspector, you can set the size of the object in three axes: X, Y and Z

Read more about the 3D editor interface in the article “Getting to know the interface”

Blockly

Actions

  • Set scale X: Y: Z: - instantly sets the scale of the specified object
  • Scale to X: Y: Z: for N sec. - scales the object to the specified values within the specified time. The change is relative to the current (at the moment of block actuation) scale of the object

Specifying three axes for scaling in the Blockly editor is equivalent to specifying them in the scene editor in the inspector in the object parameter “Scale”

  • Scale to N times for M sec. - scales the object by the specified number of times during the specified time. The change is relative to the current (at the moment of block actuation) scale of the object
  • Close/stop/continue any scaling - blocks controlling object scaling:Finish - block parameter that finishes any scaling of the objectSuspend - block parameter, which suspends object scalingContinue - block parameter that resumes object scaling, which was paused by the Pause block

Variables

  1. Object is scaled at the moment - returns “true” if the object is scaled at the moment. Otherwise, it returns “false”
  2. Get scale by Object on axis X/Y/Z - returns the scale of the specified object along the chosen axis in world coordinates
  3. Get from Object scale - returns the scale of the specified object in world coordinates as a vector

Events

  1. Completed any scaling for Object - the event is triggered when the specified object completes any scaling. Scaling is considered completed if the object reached the target scale or if the scaling was stopped by the corresponding block. The object, for which the event was triggered, is passed to the parameter

Examples of use

Obtaining object data

Let’s see an example of how some of the blocks in section “Variables” work

To implement the example, we will use a chain whose update is performed all the time. Let’s put a logical condition inside it, which will be fulfilled if the cube is not scaled. If the condition is true, the values of two parameters will be passed to the “Text” object:

  • Returns the scale of the object along the X axis
  • Returns the object scale on all three axes X, Y, Z