In RSX Engine, logic and behaviors bring your scenes to life: from simple rotations and animations to dynamic AI, physics interactions, and complex interactive systems. This chapter reiterates on the foundational Scene Object and Component concepts introduced earlier, then walks through creating a basic behavior two ways: via TypeScript scripting (for code-driven control) and the Carbon Logic Graph (for visual, node-based scripting).
Whether you're a programmer or a designer, RSX supports both approaches seamlessly, and you can mix them in the same project.
As covered in earlier guides, Scene Objects are the entities in your 3D world, like actors on a stage. They're hierarchical (parents/children) and have built-in transforms (position, rotation, scale).
@rsx.Component attaches to @rsx.SceneObject to add specific functionality. They're modular building blocks:
The @rsx.Component base class provides lifecycle hooks like @rsx.Component.onEnable, @rsx.Component.onUpdate, @rsx.Component.onLateUpdate, and @rsx.Component.onDisable. Components can access their parent @rsx.SceneObject via this.sceneObject and communicate via events or direct property access.
This component-system design promotes reusability: Attach the same component to multiple objects, or combine components for emergent behaviors (e.g., FollowPath + Defend = patrolling enemy).
| @rsx.Renderable | @rsx.Light | @rsx.ParticleSystem | @rsx.Text3D |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
The table above shows a small selection of different @rsx.BuiltinComponent types that are stock RSX Engine equipment. In this chapter, we're going to build our own Component!
Let's create a trivial Rotator component that spins its @rsx.SceneObject around the Y-axis (Yaw) over time. This uses TypeScript for precise control.
The speed property will be easily tweakable through the Scene Object Inspector window.

🤔
If you are not familiar with TypeScript yet, don't worry! This tutorial does not require you to know TypeScript, you'll be able to follow along easily.
TypeScript is a powerful language that provides type-safety with incredible runtime performance. Migrating from C++, C#, Java or Javascript is easy but you'll enjoy the benefits of a highly dynamic programming language with quick compile times and type-safety!
In this chapter, we're working in the "First Person Camera" sample project that we've created earlier.
Enter Developer Mode
Create a New TypeScript Resource
Implement the Rotator behavior
export class Rotator extends Component {
// Custom properties (editable in Scene Object Inspector)
// The @inspectableField is a "decorator" it will inform RSX that this
// field can be edited by providing it with information about the type.
@inspectableField(Number)
public speed: number = 45; // Degrees per second
// Called every frame
public override onUpdate() {
// Calculate the amount of degrees to rotate per frame
const rotation: number = this.speed * Time.frameDelta;
// Rotate around Y-axis (local space) by `rotation` degrees
this.sceneObject.transform.yawWithDegrees(rotation);
}
}
Attach to a SceneObject
speed property if needed.Test
speed property while playing, the object will respond instantly!Commit the Code for Designers
This approach is great for performance-critical or algorithmic logic. For full details on lifecycle and APIs, check the @rsx.Component documentation.
For visual thinkers and designers, the Carbon Logic Graph lets you build the same Rotator behavior without writing code. Carbon is RSX's node-based system for logic, materials, animations, and AI.

🤓
The following step-by-step guide to build the graph might seem like a lot at first. But it's important to note, that it's just a few clicks when you work visually in the Carbon Logic graph. Even more, all those workflows repeat and are the same, so once you know the workflows outlined here - you can apply them to every single node in the canvas! Hold on tight, you can make it through this! 🙏
Create a New Carbon Logic Graph Resource
Open the Carbon Logic Graph
Build the Graph Layout
Add nodes via Quick Search by Right Click in the empty area, or press Space.
Type "On Update" and spawn a Carbon Logic On Update node (fires every frame and provides access to the @rsx.SceneInstance and @rsx.SceneObject).
Click the pin right next to "Scene Object" and Mouse Drag to an empty are. Quick search will now appear to select a node to spawn. Type "Get Transform" and press Return. The new node will appear.
Click the yellow "Scene Object Transform" on the Get Transform node and drag a connection to the empty space on the right. Let go to spawn Quick Search again and spawn the Yaw With Degrees node.
The new node is a "Control Flow Node", this means it needs a point in time when it executes. The Control Flow in your graph is indicated by the thick white pins and connections that now go from the Carbon Logic On Update to the new Yaw With Degrees node. The left pin is the previous step in the execution, the right pin connects to the next step in the execution.
We now have the pieces assembled to rotate our @rsx.SceneObject each frame and need the missing math that determines by how many degrees we should rotate our object. Let's create a Variable that can be controlled by the Scene Object Inspector window.
Add a Variable
Number. For now, this is exactly what we want: a regular number! However, you could easily change the type of the variable by clicking the pin left to the name, for floats, the pin color is purple.Variable to change the name, a popup will appear, enter Speed.0.0 to 45.0.Create Getter for 'Speed'. A node will now appear that allows you to access the value of your variable.Doing the Math to let the Rotator rotate
Speed with the time that has passed since the last frame.Number * Number and spawn the node. The new node lets you multiply one value with another.A pin is automatically connected to your variable. Let's spawn a node that gives us access to the frame delta.Time and press Enter. A node will spawn that give you access to different time values.Frame Delta pin and connect it to the B pin of the Number * Number node. You are now multiplying the Speed with the Frame Delta!Number output pin to the Angle input pin of the Yaw With Degrees node.Command+S or Cmd+S to save the graph!Attach as a Component
Test
🎉 Congratulations! You made it through it but now you are familiar with the creation of custom behaviors using both TypeScript and the Carbon Logic Graph!
You can even call your own TypeScript functions or components from a Carbon Graph by adding a @rsx.carbonLogicMethod or @rsx.carbonLogicExpression decorator to your function. Custom components are automatically detected!
You're now familiar with all the key concepts that are required to build an interactive experience or game with RSX! The final piece you're missing is how to deploy your project as a standalone application.