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

How do I make these wings move?

Asked by 5 years ago

I want to make the wings rotate and look like they are fluttering. In order to do this, I have to make them rotate anchored on one side.

Nothing happens and I get an error.

This is my script so far:

local lWing = script.Parent.lWing
local rWing = script.Parent.rWing
local lw_cframe = script.Parent.lWing.CFrame
local rw_cframe = script.Parent.rWing.CFrame

script.Parent.lWing.CFrame = CFrame.new(CFrame.Angles(0, math.rad(90), 0))
script.Parent.rWing.CFrame = CFrame.new(CFrame.Angles(0, math.rad(90), 0))

This is the error log: - bad argument #1 to 'new' (Vector3 expected, got CFrame)

Thank you for any help!

1 answer

Log in to vote
0
Answered by 5 years ago

You get the error because CFrame requires Vector3 parameters... not additional CFrame values.

Try maybe

    script.Parent.lWing.CFrame = lw_cframe * CFrame.Angles(0, math.rad(90), 0)
    script.Parent.rWing.CFrame = rw_cframe * CFrame.Angles(0, math.rad(90), 0)
Ad

Answer this question