Resizing an Object
CreatiCode last edited by creaticodeta2-mail
You can change the size of any object in the scene. Two methods will be introduced below.
The “Update Scale” Block
This block allows you to resize an object relative to its original size, either instantly or through an animation.
Scaling Percent: the ratio of the target size vs original size in each dimension. By default, 100% means the original size of the model. Note that the scaling is not relative to the current size. For example, if you scale the “X size” to 200%, then the object will double its width. But if you try to scale its X size to 200% again, nothing will change, since the object’s X size is already scaled to 200%.
Animation Time Period: By default the change in size happens instantly. However, if you specify a time period like 2 seconds, then the object will gradually change its scale in an animation during those 2 seconds.
Blocking or Not: when the animation time is more than 0 seconds, if we are in the “Blocking” mode, then blocks attached below this block will not run until the end of the animation time period. In the “Non-Blocking” mode, the blocks below will start running right away.
Here is a simple program that simulates a “heart-beat” kind of animation by repeatedly scaling the box larger then smaller:
The “Update Size” Block
If you want to update an object to a specific size directly, you can use this block.
Note that you can leave one or two of the 3 input fields as empty. For example, if the x and y size inputs are empty, and the z size is not, then the object will be scaled so that its Z size matches with the input, and the other 2 dimensions will be scaled at the same ratio.
In this example, we have an avatar that is 100 units tall. Suppose we need to double his height to 200, we can set the target Z size to 200, and leave the X and Y inputs empty. Then the avatar will be scaled up proportionally.