Ylands Tutorial - Entity operations

From Bohemia Interactive Community
Jump to navigation Jump to search

In this scene we demonstrate a few basic operations you can perform with any entity.


The Penguin Statue

When a player switches the lever back and forth the position of the statue changes. In the script you can see two ways of providing the position. Firstly it’s by specifying the xyz coordinates. The second, more convenient, is by placing a Reference point Game Logic in the scene where you want something to move and provide its position instead.


The Bird Statue

Here we deal with rotations. You specify rotations in euler angles xyz, with y axis pointing up. Because here we don’t want to provide exact rotations but instead we want add an angle to an existing rotation, we use Transform Rotation instruction.


The Anubis Statue

Most entities can be painted with custom colors - both via Editor and script. Each of those entities have up to three specific color areas which can be painted separately. When painting an entity you need to specify which of those areas (“channels”) you want to paint.


The Spawn Zone

Entities can be created via Spawn entity instruction while specifying an entity type. In this case we immediately store the created entity reference so that we can despawn it by clicking the second button.


Note:

There are two instructions for removing entities - Despawn and Disintegrate. While they both do the same, Disintegrate emulates the process when something is destroyed by causing it enough damage and it shows the “puff” effect.