Whats wrong with my plane? I'm trying to have it be steered based on where the camera is looking.

wait(3)
local mouse = game.Players.LocalPlayer:GetMouse()
local camera = game.Workspace.CurrentCamera
prevpos = 0
x = 0
y = 0
z = 0
seat = game.Workspace.Seat
while true do
    wait()
    start = Vector3.new(camera.CFrame)
    lookAt = Vector3.new(mouse.UnitRay.Direction)    
    y=camera.CFrame.lookVector.Z*10
    x=camera.CFrame.lookVector.Y*10
    y=seat.Steer*-1
    game.Workspace.Seat.BodyVelocity.Velocity = game.Workspace.Seat.CFrame.lookVector*10 
    game.Workspace.Seat.Rotatione.CFrame = CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(y),0)*CFrame.Angles(math.rad(x),0,0)
    
end

2 comments

0

You're gonna have to give us more info such as what happenes when you run your script. Any errors in the output? Or maybe it works but not the way you want it to?

0

Line 17 you put Rotatione instead of Rotation.