RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"code a working spaceship system for my roblox project"
-- ScripterAI can only help with scripting as of now so here's a basic script for a spaceship control system local vehicleSeat = script.Parent.VehicleSeat local bodyVelocity = script.Parent.BodyVelocity local bodyGyro = script.Parent.BodyGyro local thrust = 1000 local turnSpeed = 1000 local function updateVelocity() bodyVelocity.Velocity = vehicleSeat.CFrame.lookVector * (thrust * vehicleSeat.Throttle) end local function updateOrientation() local steer = vehicleSeat.Steer bodyGyro.CFrame = bodyGyro.CFrame * CFrame.Angles(0, math.rad(steer * turnSpeed), 0) end vehicleSeat:GetPropertyChangedSignal("Throttle"):Connect(updateVelocity) vehicleSeat:GetPropertyChangedSignal("Steer"):Connect(updateOrientation) -- Note: This script assumes that the spaceship model has a VehicleSeat named 'VehicleSeat', a BodyVelocity named 'BodyVelocity', and a BodyGyro named 'BodyGyro'. Adjust the 'thrust' and 'turnSpeed' variables as needed for your spaceship's performance.