CI / quality (push) Successful in 1m1s
Per user direction, the MVP is now simply driving cars on the expressway. - Removed RaceManager and Economy modules entirely - Slimmed Remotes to DataUpdated / SpawnCar / EquipCar - ProfileTemplate now just remembers the last driven car (v2) - Cars: dropped price/rep/upgrade fields; kept identity + driving stats - CarManager: stat-based tuning only; RX-7 allowlist via GameConfig.canDrive - DataManager: assign default car on join; downgrade RX-7 if de-allowlisted - Client: replaced garage/economy UI with a simple car picker + respawn - Docs: GDD/ROADMAP/README rewritten for drive-only; added docs/MESH_SWAP.md - Gates: stylua clean, selene 0/0, rojo builds
85 lines
3.3 KiB
Markdown
85 lines
3.3 KiB
Markdown
# Swapping the placeholder RX-7 for the real mesh (M1)
|
|
|
|
Right now every car is a coloured block + a `VehicleSeat` so the game is drivable
|
|
today. This is the **one file** you touch to make the RX-7 a real model:
|
|
`src/server/CarManager.luau` → the `buildCarModel` function.
|
|
|
|
Nothing else (saving, the allowlist, car switching, the map, anti-cheat) needs to
|
|
change. That's the whole point of isolating model-building in one function.
|
|
|
|
## Reference photos
|
|
The real car's reference photos live on the NAS (too large to commit to git):
|
|
|
|
```
|
|
unraid-1:/mnt/user/data/yy-roblox-games/0-fast-n-furious-sim/001-1993 Mazda RX-7/
|
|
```
|
|
|
|
A single downscaled reference is included at `assets/reference/rx7-reference.png`
|
|
for quick lookups.
|
|
|
|
## Step 1 — Get a model into Roblox
|
|
Options, easiest first:
|
|
1. **Buy or find a free RX-7 FD model** on the Roblox Creator Marketplace/toolbox,
|
|
or
|
|
2. **Model it** in Blender from the reference photos and import the mesh
|
|
(`.fbx`/`.obj`) via Studio's 3D importer, or
|
|
3. Commission one.
|
|
|
|
You want a single `Model` whose parts are welded together, with a clear "body"
|
|
part you can drive. Keep the part count low (mobile perf).
|
|
|
|
## Step 2 — Store it where Rojo/Studio can clone it
|
|
Put the finished `Model` under `ReplicatedStorage` (e.g. a `CarModels` folder).
|
|
Two ways to manage it:
|
|
- **Simple:** keep it in the Studio place file as a real Instance (not synced by
|
|
Rojo). Fine for a single hero car.
|
|
- **Version-controlled:** export the model to a `.rbxm` and reference it from the
|
|
Rojo project so it lives in git. See Rojo's `$path` docs for `.rbxm` model files.
|
|
|
|
## Step 3 — Rewrite `buildCarModel` to clone the real mesh
|
|
Replace the block-building body of `buildCarModel(car, maxSpeed, torque, turnSpeed)`
|
|
with something like:
|
|
|
|
```lua
|
|
local CAR_MODELS = ReplicatedStorage:WaitForChild("CarModels")
|
|
|
|
local function buildCarModel(car, maxSpeed, torque, turnSpeed)
|
|
-- Look up a real model by car id; fall back to the block builder if missing.
|
|
local template = CAR_MODELS:FindFirstChild(car.Id)
|
|
if not template then
|
|
return buildBlockCar(car, maxSpeed, torque, turnSpeed) -- keep the old code as a fallback
|
|
end
|
|
|
|
local model = template:Clone()
|
|
|
|
-- Ensure it has a VehicleSeat named "DriveSeat" welded to the driving body.
|
|
local seat = model:FindFirstChild("DriveSeat")
|
|
if not seat then
|
|
seat = Instance.new("VehicleSeat")
|
|
seat.Name = "DriveSeat"
|
|
-- weld seat to model.PrimaryPart, position it in the cabin...
|
|
seat.Parent = model
|
|
end
|
|
seat.MaxSpeed = maxSpeed
|
|
seat.Torque = torque
|
|
seat.TurnSpeed = turnSpeed
|
|
|
|
assert(model.PrimaryPart, "Car model needs a PrimaryPart set")
|
|
return model
|
|
end
|
|
```
|
|
|
|
Keep the current block-builder renamed as `buildBlockCar` so any car without a
|
|
real mesh still works. That way you can import cars one at a time.
|
|
|
|
## Step 4 (recommended, M1) — Move to a real chassis
|
|
The `VehicleSeat` is great for "it drives today" but for real suspension/grip,
|
|
adopt a proven **constraint chassis** (A-Chassis or a modern equivalent). At that
|
|
point `buildCarModel` clones the chassis rig and attaches the RX-7 body to it.
|
|
Still one function; still no changes elsewhere.
|
|
|
|
## Verify
|
|
- `rojo build --output build.rbxl` compiles.
|
|
- In Studio: Play → you spawn in the real RX-7 → it drives → it saves.
|
|
- Non-allowlisted test account still can't select the RX-7 (server enforced).
|