# Adding behaviors in CGE editor (TCastleBillboard, TCastleSoundSource)

**URL:** https://forum.castle-engine.io/t/adding-behaviors-in-cge-editor-tcastlebillboard-tcastlesoundsource/369
**Category:** News
**Created:** [July 18, 2021, 6:05pm UTC](https://forum.castle-engine.io/t/adding-behaviors-in-cge-editor-tcastlebillboard-tcastlesoundsource/369 "2021-07-18T18:05:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [July 18, 2021, 6:05pm UTC](https://forum.castle-engine.io/t/adding-behaviors-in-cge-editor-tcastlebillboard-tcastlesoundsource/369/1 "2021-07-18T18:05:03Z")

</div>

| [![Design: Werewolf, from a sprite sheet, is also a billboard and emits a 3D sound](https://castle-engine.io/wp/wp-content/uploads/2021/07/Zrzut-ekranu-z-2021-07-18-00-56-40-200x114.png)](https://castle-engine.io/wp/wp-content/uploads/2021/07/Zrzut-ekranu-z-2021-07-18-00-56-40.png "Design: Werewolf, from a sprite sheet, is also a billboard and emits a 3D sound") |
| [![Werewolf, from a sprite sheet, is also a billboard and emits a 3D sound](https://castle-engine.io/wp/wp-content/uploads/2021/07/Zrzut-ekranu-z-2021-07-18-00-56-05-200x117.png)](https://castle-engine.io/wp/wp-content/uploads/2021/07/Zrzut-ekranu-z-2021-07-18-00-56-05.png "Werewolf, from a sprite sheet, is also a billboard and emits a 3D sound") |

You can now add/remove _behaviors_ using the [CGE editor](https://castle-engine.io/manual_editor.php). “Behaviors” are components that enhance the behavior of the parent [TCastleTransform](https://castle-engine.io/apidoc-unstable/html/CastleTransform.TCastleTransform.html). We have a few of them included in CGE, and you can define more (_“3D FPS Game”_ template shows a trivial behavior of an enemy).

If you come [from Unity](https://github.com/castle-engine/castle-engine/wiki/Castle-Game-Engine-for-Unity-developers), know that _“creating TCastleBehavior”_ is now the closest equivalent to Unity _“creating MonoBehaviour”_.

The behaviors you can add now using the editor are:

1. [TCastleBillboard](https://castle-engine.io/apidoc-unstable/html/CastleBehaviors.TCastleBillboard.html). Turns any `TCastleTransform` into a billboard (visually, in the editor, too). Billboard automatically rotates (around some axis, or freely) to face the camera. `TCastleBillboard` is now our advised way to make billboards in CGE (much simpler to use than X3D node `TBillboardNode`, which we advised in the past).

It exposes [AxisOfRotation](https://castle-engine.io/apidoc-unstable/html/CastleBehaviors.TCastleBillboard.html#AxisOfRotation), by default +Y axis. Simply set it to zero `Vector3(0, 0, 0)` to rotate the transformation freely, to always face the camera.

2. [TCastleSoundSource](https://castle-engine.io/apidoc-unstable/html/CastleBehaviors.TCastleSoundSource.html). This makes the parent `TCastleTransform` emit a sound. Such sound has a 3D position and can be _spatialized_, which means that distance of the emitter affects the volume, and position of the emitter affects whether you hear it more from the left or right side. More on this in later news about sounds 🙂

A simple example of it is now in [examples/creature\_behaviors](https://github.com/castle-engine/castle-engine/tree/master/examples/creature_behaviors). The wolf is a sprite sheet, and a billboard, and it emits a _“howling”_ sound.
