Templates in RSX Engine are the solution for creating reusable, modular assets. A Template can be easily instanced to quickly create complex configurations or hierarchies of Scene Objects, much like Prefabs in Unity or Blueprints in Unreal. A Template captures a group of scene objects (with their components, transforms, and nested structures) into a single, savable, editable and versioned @rsx.Resource. You can instantiate it multiple times in a scene, override properties on individual instances, and even add new child objects without breaking the original Template.
Template nesting lets you embed one Template inside another for deeply modular designs (e.g., a "Wheel" Template nested in a "Car" Template). Plus, changes to the master Template can automatically propagate to instances while preserving your custom "overrides" (like a tweaked rotation or added @rsx.Component). If you need full independence, simply "break the link" to turn an instance into standalone scene objects.
Templates are excellent to abstract complexity or make level creation easier: from buildings and characters to props and entire city sections, everything can be a Template! They're stored as resources in your Library, making them easy to version, edit, and instance in a scene.
Missing Content: Show template instances and overrides
In this section, we're going to learn how to quickly create our own Template and instance it in the scene. We'll override properties of our instance and modify the template.
As in the previous chapter, it is assumed that you have the "First Person Camera" tutorial open in RSX.
Box using the Scene Object Inspector.Light.Light up and centered over the Box, so it neatly illumates the box and the world around it.
Missing Content: Show the scene configuration and outliner
Box Scene Object (the top-level parent).Menu File → Create → New Template from Selection.Box object will automatically be converted to an instance of the newly created Template!Missing Content: Show the menu
Missing Content: Show the process
Light of one of your template instances in the scene.Color Mode property in the Scene Object Inspector to RGB.Color RGB by clicking the field and selecting a blue color.Missing Content: Show the process
Sky Scene Object in the Scene Outliner of the Template Editor. Select it and press H to disable the sky, or click the icon when hovering over the Sky.Color RGB red instead of blue.Missing Content: Show the process
Light template instance without the blue light override in the Scene Editor.Color RGB property of the Light to a green color.Save Template button in the Scene Object Inspector.For imported meshes (e.g., FBX characters), RSX can automatically create a Template during import. In the import dialog, enable Create Template to get a ready-to-use hierarchy with materials, skeletons, and animation clips assigned.
Missing Content
Nesting templates lets you compose larger templates from smaller building blocks, without limitations on the nesting depth. This enables you to abstract complexity, by compartmentalizing behaviors and component configuration.
To build a group of AI Agents or NPCs a single template called NPC Group can be created, that instances multiple AI Agent templates.
Another situation might be creating a Building template from several Floor templates and a Roof template. Then taking the Building template and instancing it in a City Block template that also instances a Street and Bench template. To further this concept, the City Block template could be instanced several times into a City District template.
Missing Content: Show process of creating nested template from templates.
Breaking a template link can be usedful, to avoid changes from the underlying to propagate to the Scene Object, when the template is reinstanced upon changes.
Breaking the template link of a Scene Object can be done in several ways:
It can also be done using the Scene Outliner:
Missing Content: Show process of breaking template link.
Templates are at the hear of RSX Engine. They can be automatically created when you import a mesh, or setup quickly from the Scene Editor or Scene Outliner.
🥳 Congratulations! You are now familiar with the powerful template system in RSX. Use it to build complex abstractions that you can quickly instance, and reuse in different scenarions by using overrides. Next, we're going to learn how to turn our RSX Editor Project into a standalone application.