Hello fellow devs,
I have been trying to achieve this:
I have been trying to play around with the Orientation and CFrame but cant get that bounce effect, also I have to find out how to tween the mesh parts all at once. I am also trying to get the bounce to the other side more smooth and less choppy.
while true do
yourModel.PrimaryPart.CFrame:Lerp("Paste Your CFrame", "type your time (1) second")
wait("the time of the lerp")
yourModel.PrimaryPart.CFrame:Lerp("Paste Your CFrame", "type your time (1) second")
wait("the time of the lerp")
end
Use TweenService on the primary part. You can create an animation, make it repeat forever, and set your easing style to whatever best suits the “bounce” back from either side of the plane’s roll.
local TweenService = game:GetService("TweenService")
local Model = script.Parent
local PrimaryPart = Model.PrimaryPart -- Assuming PrimaryPart is what you want to animate
--[[
2 is the time taken to complete the animation.
EasingStyle determines the bounce back effect.
Leave Direction as InOut otherwise the effect will only happen on one side of the roll
-1 makes the animation repeat forever, true makes it reverse once it reaches the end
--]]
local AnimationInfo = TweenInfo.new(
2,
Enum.EasingStyle.Sine,
Enum.EasingDirection.InOut,
-1,
true
)
-- Play around with whatever angles best suits your needs. Z is for roll which is most likely all you'll need for a simple plane
local StartCFrame = PrimaryPart.CFrame * CFrame.Angles(0, 0, math.rad(10))
local EndCFrame = PrimaryPart.CFrame * CFrame.Angles(0, 0, math.rad(-10))
-- Set the start pose
PrimaryPart.CFrame = StartCFrame
-- Create the animation
local Animation = TweenService:Create(PrimaryPart, AnimationInfo, {["CFrame"] = EndCFrame})
-- CFrame must be written as ["CFrame"] as otherwise it thinks you want to use the inbuilt CFrame library instead of CFrame as an index in the table
Animation:Play()
Note: I have not tested this myself but it should work. If it doesn’t let me know and ill see what i did wrong!
Also, make sure that the rest of your plane is welded to the primary part and that only the primary part is anchored, otherwise the plane will not animate alongside the primary part.