Scene Graph Move Entity
Move a scene-graph entity by setting its transform's translation — slide a platform, reposition a prop, place a freshly spawned entity in the world.
Every entity in your scene carries a transform — its position, rotation, and scale in the world. To move a platform, you just hand it a transform with a new position.
Think of the transform as the blueprint that stamps where your entity sits. Keep the rotation and scale, swap in a fresh Translation, and the platform jumps to the new spot.
First we grab the platform entity and read its current transform. We build a vector3 for the new location, then make a fresh transform that reuses the old rotation and scale but uses our new Translation. Finally SetGlobalTransform places it there.
Set a new Translation on the transform, and your entity moves. That's how you slide platforms and place props.
Platform : entity = SomeEntity
Current := Platform.GetTransform()
NewSpot := vector3{X := 500.0, Y := 0.0, Z := 200.0}
Moved := transform{Translation := NewSpot, Rotation := Current.Rotation, Scale := Current.Scale}
Platform.SetGlobalTransform(Moved)
Build your own lesson with scene_graph_move_entity
Generate a personalized, compile-checked lesson grounded in this exact reference.
Build a lesson →