# Various engine improvements: lift lights limit, test simultaneous animations, fix changing TLevel.Player, SaveScreenRgba...

**URL:** https://forum.castle-engine.io/t/various-engine-improvements-lift-lights-limit-test-simultaneous-animations-fix-changing-tlevel-player-savescreenrgba/240
**Category:** News
**Created:** [October 22, 2020, 9:46pm UTC](https://forum.castle-engine.io/t/various-engine-improvements-lift-lights-limit-test-simultaneous-animations-fix-changing-tlevel-player-savescreenrgba/240 "2020-10-22T21:46:32Z")
**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: [October 22, 2020, 9:46pm UTC](https://forum.castle-engine.io/t/various-engine-improvements-lift-lights-limit-test-simultaneous-animations-fix-changing-tlevel-player-savescreenrgba/240/1 "2020-10-22T21:46:33Z")

</div>

| [![Zrzut ekranu z 2020-10-22 22-53-57](https://castle-engine.io/wp/wp-content/uploads/2020/10/Zrzut-ekranu-z-2020-10-22-22-53-57-200x122.png)](https://castle-engine.io/wp/wp-content/uploads/2020/10/Zrzut-ekranu-z-2020-10-22-22-53-57.png "Zrzut ekranu z 2020-10-22 22-53-57") |
| [![Zrzut ekranu z 2020-10-22 22-54-04](https://castle-engine.io/wp/wp-content/uploads/2020/10/Zrzut-ekranu-z-2020-10-22-22-54-04-200x122.png)](https://castle-engine.io/wp/wp-content/uploads/2020/10/Zrzut-ekranu-z-2020-10-22-22-54-04.png "Zrzut ekranu z 2020-10-22 22-54-04") |
| [![Zrzut ekranu z 2020-10-22 21-40-10](https://castle-engine.io/wp/wp-content/uploads/2020/10/Zrzut-ekranu-z-2020-10-22-21-40-10-200x114.png)](https://castle-engine.io/wp/wp-content/uploads/2020/10/Zrzut-ekranu-z-2020-10-22-21-40-10.png "Zrzut ekranu z 2020-10-22 21-40-10") |
| [![Zrzut ekranu z 2020-10-22 21-40-27](https://castle-engine.io/wp/wp-content/uploads/2020/10/Zrzut-ekranu-z-2020-10-22-21-40-27-200x114.png)](https://castle-engine.io/wp/wp-content/uploads/2020/10/Zrzut-ekranu-z-2020-10-22-21-40-27.png "Zrzut ekranu z 2020-10-22 21-40-27") |

Here goes an unorganized list of engine features and fixes done lately 🙂 Enjoy, and see if you can find something for yourself in this menu 🙂

1. You can now increase the number of allowed lights per shape using [Scene.Attributes.MaxLightsPerShape](https://castle-engine.io/apidoc-unstable/html/CastleRenderer.TRenderingAttributes.html#MaxLightsPerShape). [view3dscene](https://castle-engine.io/view3dscene.php) has a menu item to experiment with it (_“View -\> Max Lights Per Shape…”_). A test model is in [demo-models: gltf/multiple\_animated\_lights](https://github.com/castle-engine/demo-models/tree/master/gltf/multiple_animated_lights).

2. [view3dscene](https://castle-engine.io/view3dscene.php) allows to test multiple simultaneous animations. Just select the checkbox _Enable Multiple Simultaneous Animations_ in the animations panel (Ctrl + A), and now you start/stop the animations independently. The animations are controlled using `TTimeSensorNode.Start` and `TTimeSensorNode.Stop`, just like in the [example simultaneous\_animations\_one\_scene](https://github.com/castle-engine/castle-engine/tree/master/examples/animations/simultaneous_animations_one_scene).

3. Thanks to _Andrzej Kilijański_, changing `TLevel.Player` after the level is loaded is now fixed. This fixes various applications relying on it, like [the old “The Castle” game](https://github.com/castle-engine/castle-game/). It is demonstrated by [fps\_game example](https://github.com/castle-engine/castle-engine/tree/master/examples/fps_game), just press F1 to recreate player. It works reliably in all cases, with 1st and 3rd-person navigation.

4. In code you can iterate using `for .. in` over `TCastleTransform` and `TCastleUserInterface` children.

5. Fixed opening Lazarus when it is installed from Debian packages (`lazarus-ide` binary), thanks to _Eugene Loza_.

6. [TCastleViewport.PositionToRay](https://castle-engine.io/apidoc-unstable/html/CastleViewport.TCastleViewport.html#PositionToRay) utility. This allows to get a 3D ray from a 2D viewport position and use this ray to e.g. perform collisions with the world geometry to determine anything you like.

7. [TUIContainer.SaveScreenRgba method](https://castle-engine.io/apidoc-unstable/html/CastleUIControls.TUIContainer.html#SaveScreenRgba) allows to grab a screenshot to RGBA image. An example is [in examples/short\_api\_samples/save\_screen\_rgba/save\_screen\_rgba.lpr](https://github.com/castle-engine/castle-engine/blob/master/examples/short_api_samples/save_screen_rgba/save_screen_rgba.lpr).

8. Fixed glTF look in case of no explicit material.

9. Fixed gravity when reading glTF camera (in glTF, gravity is always +Y).

10. Fixed [TCastleViewport.Transparent](https://castle-engine.io/apidoc-unstable/html/CastleViewport.TCastleViewport.html#Transparent) to ignore X3D Background nodes (it was always documented like this, but got accidentally broken ~year ago).
