ReferenceScene Graph

Scene Graph Rotate Entity

Rotate an entity by setting its transform's rotation — spin a coin, turn a turret toward a target, open a hinged door. Orientation is part of the transform.

Updated Compile verifiedExamples verified on the live UEFN compiler

Want a coin that spins, or a turret that turns to face you? You don't move it — you change the rotation part of its transform.

Think of a crafting station: you feed in the coin's current transform, the machine adds a turn, and out pops the same coin facing a new way.

First we build Spin, a 90-degree turn around the up axis. We read the coin's Current transform, then RotateBy adds our spin to its existing facing. Finally TeleportTo keeps the same position but applies the NewRotation — and the coin turns.

An entity's facing is just part of its transform. Set the rotation to turn it.

Spin : rotation = MakeRotationFromYawPitchRollDegrees(90.0, 0.0, 0.0)
Current : transform = GetTransform()
NewRotation : rotation = Current.Rotation.RotateBy(Spin)
if (TeleportTo[Current.Translation, NewRotation]):
    Print("Coin turned!")

Build your own lesson with scene_graph_rotate_entity

Generate a personalized, compile-checked lesson grounded in this exact reference.

Build a lesson →