Draft preview · this lesson is still being technically validated. Browser experiments and reference material remain available; trusted completion is enabled after publication.

← Back to journey

Move a door relative to its starting pose

v2 · Activity 1 of 0 · vector3 · cframe · position · 28 min Requires Roblox Studio

Chapter outline
Loading draft…
Mini-mission

Vector3 holds three components and can represent a position or offset. CFrame holds position and orientation. Part.CFrame therefore describes the whole pose.

Capture the closed pose once, then derive the open pose by a local CFrame offset. This preserves the builder’s original orientation.

Your task

Create SlidingDoor and raise it four studs relative to its closed pose after two seconds. Restore its closed pose after two more seconds.

Interface: Complete the documented Studio hierarchy and self-check the behavior outside the browser.

InputExpected
Syntax in this activity

New syntax: vector3, cframe, position

Earlier ideas used here
  • events
  • connections
Self-check rubric
  • The door stays at its original X/Z location rather than teleporting to the origin.
  • The closed pose after the return matches the starting pose.

Your explanation is a self-check. Exact wording is not automatically graded.

Self-checked Studio exercise. A saved checklist records your own review; no uploaded place file or screenshot is executed here.

Build this hierarchy

Workspace/SlidingDoor (Part, Anchored=true)
ServerScriptService/DoorPose (Script, RunContext=Server)
  1. Create SlidingDoor with Size 4,6,1 and Position 6,3,0.
  2. Rotate it around Y if you want to observe local versus world offsets.
ServerScriptService/DoorPose.server.luau

Main guided reference implementation; use the hierarchy’s stated Script or ModuleScript type.

local door = game:GetService("Workspace"):WaitForChild("SlidingDoor")
local closed = door.CFrame
local open = closed * CFrame.new(0, 4, 0)
task.wait(2)
door.CFrame = open
task.wait(2)
door.CFrame = closed

Expected output

  • The door raises four local Y studs, then returns exactly to its starting pose.

Studio assessment checklist

Multiplayer tests

  1. Run a local server and at least one client; compare server and client context where the activity uses both.
Troubleshooting and production considerations

Check Anchored and the exact SlidingDoor name.

Repeatedly adding to the current pose can accumulate drift; capture the base pose once.

This is a bounded learning lab. It has not been executed in an approved Roblox Studio environment by this website.

A checked checklist records your own review, not automated project competence or a community verification.

Your goal

Create SlidingDoor and raise it four studs relative to its closed pose after two seconds. Restore its closed pose after two more seconds.

Reset starter

Replace this code with the starter? Download your draft to keep a copy.

Code

Studio source file
Luau keyword highlighting · Ctrl/⌘ + Enter: Run · Esc: leave editor

Edit and run these files in Roblox Studio. This browser has no Roblox services, physics, or replication.

Your output will appear here.

Ready