Hey,
I want to make cool animation where you start flying up.
Here is how the animation should work:
- First player fly up little bit
- Then fall a bit
- Then fly up first with a slow speed and then speeds up.
During this TweenAnimation I also made own Character animation.
The problem is that the camera is buggy and the animation looks little bit weird. In the video character goes a little bit too down and I fixed it but still player sometimes teleports and looks laggy. Here is the video and localscript:
local TweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local rebirtha = script.rebirth
local rebirtha2 = script.rebirth2
local humanoid = player.Character:WaitForChild("Humanoid")
local rebirthanimation = humanoid:LoadAnimation(rebirtha)
local rebirthanimation2 = humanoid:LoadAnimation(rebirtha2)
script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local riseinfo = TweenInfo.new(
2,
Enum.EasingStyle.Sine,
Enum.EasingDirection.InOut
)
local riseinfo2 = TweenInfo.new(
5,
Enum.EasingStyle.Quint,
Enum.EasingDirection.In
)
local plrlocation = character.HumanoidRootPart.CFrame
local riseanim = TweenService:Create(character.HumanoidRootPart, riseinfo, {CFrame = plrlocation + Vector3.new(0, 30, 0)})
local miniriseanim = TweenService:Create(character.HumanoidRootPart, riseinfo, {CFrame = plrlocation + Vector3.new(0, 10, 0)})
local minifallanim = TweenService:Create(character.HumanoidRootPart, riseinfo, {CFrame = plrlocation - Vector3.new(0, 10, 0)})
local riseanim2 = TweenService:Create(character.HumanoidRootPart, riseinfo2, {CFrame = plrlocation + Vector3.new(0, 250, 0)})
game.Workspace.nopass.CanCollide = false
rebirthanimation:Play()
riseanim:Play()
riseanim.Completed:wait()
plrlocation = character.HumanoidRootPart.CFrame
minifallanim = TweenService:Create(character.HumanoidRootPart, riseinfo, {CFrame = plrlocation - Vector3.new(0, 10, 0)})
minifallanim:Play()
minifallanim.Completed:Wait()
plrlocation = character.HumanoidRootPart.CFrame
riseanim2 = TweenService:Create(character.HumanoidRootPart, riseinfo2, {CFrame = plrlocation + Vector3.new(0, 250, 0)})
riseanim2:Play()
end)