So I got this plane that moves depending on the lookvector but I can’t seem to get the plane to turn. I tried using AlignOrientation but it didn’t work.
local plane = script.Parent
local VehicleSeat = plane:WaitForChild("VehicleSeat")
local FlyPart = plane:WaitForChild("FlyPart") -- just a part infront of the plane
local LinearVelocity = FlyPart:WaitForChild("LinearVelocity")
local AlignOrientation = FlyPart:WaitForChild("AlignOrientation")
local Configurations = plane:WaitForChild("Configurations")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local speed = Configurations.Speed
RunService.Heartbeat:Connect(function()
LinearVelocity.VectorVelocity = FlyPart.CFrame.LookVector * speed.Value
end)
while true do
local delta = RunService.Heartbeat:Wait()
if VehicleSeat.Throttle == 1 then
AlignOrientation.CFrame *= CFrame.Angles(0, 10, 0)
end
if VehicleSeat.Throttle == -1 then
AlignOrientation.CFrame *= CFrame.new(0, -10, 0)
end
if VehicleSeat.Steer == 1 then
AlignOrientation.CFrame *= CFrame.new(0, 0, 0.1)
end
if VehicleSeat.Steer == -1 then
if VehicleSeat.Throttle == 0 or VehicleSeat.Throttle == 1 then
AlignOrientation.CFrame *= CFrame.new(0, 0, -0.1)
end
end
end
I can’t seem to get the Orientation inside the AlignOrientation.CFrame.
Any help is appreciated!