How can I make the attachment move to make it look like it's flapping?

  1. What do you want to achieve? a wing flapping effect using attachments and particles

  2. What is the issue? I don’t know how to make it continuous or if it’s even possible.

  3. What solutions have you tried so far? I’ve tried to make a script (the one below) but it didn’t work

All help is appreciated :>

here’s the code:

local attachment = script.Parent

while true do
	for count = 1,5 do
		attachment.Orientation += Vector3.new(0,4,0)
	end
	wait(0.1)
	for count = 1,5 do
		attachment.Orientation -= Vector3.new(0,4,0)
	end
end

here’s what the wings look like:

1 Like

can we get a description of how the wings work with attachments? that way we can figure out how to make the attachments move.

Use Tween Service to Rotate the Parts. I will send you a script later, im not home yet

Can use tween service for this or you have use a stepped sin wave to control the rotation of the attachment.

I would probably use the TweenService method as all you need is one line of code to run it all.

local TweenService = game:GetService("TweenService")
local TweenInformation = TweenInfo.new(
    1,
    Enum,EasingStyle.Sine,
    Enum.EasingDirection.InOut,
    - 1, -- Repeat forever
    true -- Go backwards
)
local Part = workspace.Part -- You can change this to your instance.

-- Part will rotate between -45 and 45 in sine wave manner
local RAD_45 = math.rad(45)
local StartCFrame = CFrame.Angles(0,RAD_45,0) -- Set part to start at 45
local Goal = {
    CFrame = CFrame.Angles(0,RAD_45 * 2,0) -- Should tween to
}

Part.CFrame *= StartCFrame -- SetupPart
local Tween: Tween = TweenService:Create(Part,TweenInformation,Goal)
Tween:Play()

I haven’t tested the code but I think it should work. This is how you would set it up. You can also try and look at other easing styles if the sine wave does not suit your style.

1 Like

It’s basically a particleEmitter emitting from the attachment. When i move the attachments in studio, the wings move with it.

Thank you so much, I’ll check this out and try to get it to work!