Vehicles, Portals & Custom Movement
MechanicsHandling high-speed cars, mount physics, launch pads, portals, and directional dash skills.
# Vehicle Physics & Seat Awareness
When a player character sits in a VehicleSeat, Roblox transfers network ownership of the vehicle assembly to the client driver. The vehicle may reach speeds of $100\text{ to }300\text{ studs/s}$, which would trigger standard infantry speed checks.
# Automatic Exemption
RAC automatically checks humanoid.Sit and playerState.isSeated. When seated in a VehicleSeat:
- Standard infantry speed limits are replaced with
Config.Detectors.Speed.VehicleSpeedMultiplier(default $5.0 \times$). - Flight and downward ground raycasts are paused.
- When the player exits the seat, normal pedestrian physics monitoring resumes after a $1.0\text{s}$ grace period.
# Launch Pads & Jump Boosters
For bounce pads or fan blowers that launch characters into the sky:
local RAC = require(game.ServerScriptService.RAC.Core.Engine)
local function OnLaunchPadTouched(launchPad: BasePart, hitPart: BasePart)
local player = game.Players:GetPlayerFromCharacter(hitPart.Parent)
if not player then return end
-- Grant a 3-second exemption for the high arc trajectory
RAC:AddExemption(player, "LaunchPadArc", 3.0)
local root = hitPart.Parent:FindFirstChild("HumanoidRootPart") :: BasePart?
if root then
root.AssemblyLinearVelocity = Vector3.new(0, 150, 80)
end
end
# Wormholes & Spatial Portals
For portals that instantaneously warp players across different zones:
local function UsePortal(player: Player, destinationCFrame: CFrame)
-- Grant a 1.5-second teleport grace
RAC:AddExemption(player, "PortalWarp", 1.5)
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
if root then
root.CFrame = destinationCFrame
end
end
# Next Steps
- Learn how to extend RAC in Creating Custom Detectors.
- Review Trust Boundaries.