Reality Composer Pro 3 introduces visual, node-based Animation Graphs, Behavior Trees, Script Graphs, and Navigation Mesh support for authoring rich character animation, autonomous AI routines, and interactive spatial scenes entirely within the editor β no code required for core logic.
β’ Animation Graph enables smooth blend-space transitions between animation clips (e.g., idleβwalk) driven by runtime parameters, replacing hand-rolled state machines in Swift code.
β’ Behavior Trees let you define multi-step autonomous character routines (MoveTo, RotateToFace, Wait, ParameterSetter) visually, testable live in the editor without a build cycle.
β’ Script Graph provides event-driven interactivity (tap gestures, initialization hooks) that wires Behavior Tree inputs to real-time user actions, all without leaving Reality Composer Pro.
Demonstrates how to load a Reality Composer Pro 3 scene containing an Animation Graph character, then drive its isWalking parameter and trigger its Behavior Tree from Swift at runtime.
import SwiftUI
import RealityKit
import RealityKitContent
// MARK: - SwiftUI entry point
@main
struct AlchemistApp: App {
var body: some Scene {
WindowGroup {
AlchemistView()
}
}
}
// MARK: - View
struct AlchemistView: View {
@State private var rootEntity: Entity?
@State private var alchemist: Entity?
var body: some View {
RealityView { content in
// Load the scene exported from Reality Composer Pro 3
// The scene contains the Animation Graph and Behavior Tree components
if let scene = try? await Entity(named: "AlchemyArea", in: realityKitContentBundle) {
content.add(scene)
rootEntity = scene
// Grab the alchemist entity by name (as set in RCP3 scene graph)
alchemist = scene.findEntity(named: "Alchemist")
}
} update: { _ in
// RealityView update closure β nothing needed here for this demo
}
.gesture(
TapGesture().targetedToAnyEntity().onEnded { value in
guard let alchemist,
value.entity == alchemist else { return }
triggerBrewingRoutine(on: alchemist)
}
)
.onAppear {
// After a short delay, start the idle-to-table routine
Task {
try? await Task.sleep(for: .seconds(1))
if let alchemist {
startTableRoutine(on: alchemist)
}
}
}
}
// MARK: - Animation Graph parameter helpers
/// Sets the Animation Graph `isWalking` boolean parameter on the entity.
private func setWalking(_ walking: Bool, on entity: Entity) {
// AnimationGraphComponent exposes a parameters dictionary
// keyed by the input names defined in Reality Composer Pro 3.
if var animGraph = entity.components[AnimationGraphComponent.self] {
animGraph.parameters["isWalking"] = .bool(walking)
entity.components[AnimationGraphComponent.self] = animGraph
}
}
// MARK: - Behavior Tree helpers
/// Activates the table sub-sequence by ensuring readyToBrew is false.
private func startTableRoutine(on entity: Entity) {
if var behaviorTree = entity.components[BehaviorTreeComponent.self] {
behaviorTree.parameters["readyToBrew"] = .bool(false)
entity.components[BehaviorTreeComponent.self] = behaviorTree
}
setWalking(true, on: entity)
}
/// Called when user taps the alchemist β triggers the cauldron sub-sequence.
private func triggerBrewingRoutine(on entity: Entity) {
if var behaviorTree = entity.components[BehaviorTreeComponent.self] {
behaviorTree.parameters["readyToBrew"] = .bool(true)
entity.components[BehaviorTreeComponent.self] = behaviorTree
}
setWalking(true, on: entity)
}
}Animation Graph isWalking parameter must be set via RealityKit's EntityParameter API at runtime when driving from Swift; Behavior Tree nodes like MoveTo require a NavigationMeshComponent present on the scene root entity or pathfinding silently no-ops. Script Graph subgraphs are project-local and not yet shareable as Swift packages.
Reality Composer Pro 3 requires macOS 26+. Navigation Mesh and Animation Graph runtime features require Apple Silicon. Full live preview requires Apple Vision Pro.
More iOS 27 APIs land every week.
Get notified when new capabilities are published β no noise, just signal.