local TweenBounceInfo = TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)
--// Complex Math I got from Dev Forum
local cameraOffset = CFrame.new(0, 0, -6.5) * CFrame.Angles(0, math.rad(180), 0)
local ChangeTweenPos = Instance.new("CFrameValue")
local newOffset = cameraOffset + Vector3.new(-0.25, 0, 0)
--// Seems like you didn't add the Egg in Eggs Folder. Please look in GameClient :)
if not EggsFolder:FindFirstChild(EggModel) then
warn("No egg called "..EggModel.." in EggsFolder in Replicated Storage")
EggModel = "Common Egg"
end
local Egg = EggsFolder:FindFirstChild(EggModel):Clone()
Egg.Parent = workspace
--// Using RunService we forever loop the eggDisplay
--// Why local? So we can disconnect egg display and connect when ever we want :)
local eggDisplay = RunService.RenderStepped:Connect(function()
Egg:SetPrimaryPartCFrame(Workspace.Camera.CFrame * newOffset * ChangeTweenPos.Value) -- you NEED to have the model with the RootPart as the PrimaryPart
end)
TweenService:Create(ChangeTweenPos, TweenBounceInfo, {Value == CFrame.new(1,1,1)}):Play()
TweenService:Create(ChangeTweenPos, TweenBounceInfo, {Value == CFrame.new(1,1,1)}):Play()
wont work.