Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Airship FromEulerAnglesXYZ Problem?

Asked by 8 years ago

So for some reason on click it wont move forward, and in the output it says a Nil value.Help please

the error comes out as this 17:08:41.749 - Workspace.Airship.Panel.Script:9: attempt to call field 'FromEulerAnglesXYZ' (a nil value)

local Lever1 = script.Parent.Lever1
local Lever2 = script.Parent.Lever2
local airship = script.Parent.Parent



function OnClick ()

    airship.CFrame=CFrame.FromEulerAnglesXYZ(0,1,30)
end


Lever1.ClickDetector.MouseClick:connect(OnClick)
0
its not Cframe, it's CFrame HungryJaffer 1246 — 8y
0
and there's no space after OnClick HungryJaffer 1246 — 8y
0
@HungryJaffer it still says Nil Value in output AthoronTheBrave 45 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

CFrame.fromEulerAnglesXYZ() not CFrame.FromEulerAnglesXYZ.

Also fromEulerAnglesXYZ takes radians not degrees in it's arguments.

To convert degrees to radians use math.rad(degs)

local Lever1 = script.Parent.Lever1
local Lever2 = script.Parent.Lever2
local airship = script.Parent.Parent



function OnClick ()

    airship.CFrame=CFrame.FromEulerAnglesXYZ(0,math.rad(1),math.rad(30))
end


Lever1.ClickDetector.MouseClick:connect(OnClick)
Ad

Answer this question