Tween Animation Gone Wrong

I want the iceberg to go up and down in a bounce to animate the waves and water of the map.

What really happens is the iceberg is not going up or down-

My tween code:

local TweenService = game:GetService("TweenService")
local Ice = script.Parent.Parent.Ice
local tweeningInformation = TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.InOut, 1000, true, 1)

local tween1 = {CFrame = CFrame.new(75.421, 28.117, 16.944)}
local tween2 = {CFrame = CFrame.new(75.421, 26.845, 16.944)}
local tween1open = TweenService:Create(Ice, tweeningInformation, tween1)
local tween1close = TweenService:Create(Ice, tweeningInformation, tween2)

local function playTween()
	tween1open:Play()
	wait(1)
	tween1close:Play()
end

playTween()

The position is in fact made to where I want it to be. For example, tween1 is the position that I WANT it to be in and tween2 is the position that it was in. Tween1 is slightly higher than tween2. The part also contains a mesh to make it look more like an iceberg.

Anybody have a fix?

Why does this look like something you’d see on Corruption Stockpiles LOL

From what I’m understanding, you’re wanting to tween the Iceberg’s rotation from left to right so that it’s moving 1 side down, while the other side up?

I want it to go up and down animating and making it look like its going up and down by the waves.

Hm, are you sure that you can’t just change the property to a Positional Vector3 value? Or would that result in the same outcome?

What do you mean by using a vector3 value? Like instead of CFrame, it would be Vector3.Value = …

Are you sure the iceberg is anchored? Looks like its flipping on the water

Screen Shot 2021-04-19 at 4.28.48 PM

I mean changing the property of your part from a CFrame to its Position

local TweenService = game:GetService("TweenService")
local Ice = script.Parent.Parent.Ice
local tweeningInformation = TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.InOut, 1000, true, 1)

local tween1 = {Position = Vector3.new(75.421, 28.117, 16.944)}
local tween2 = {Position = Vector3.new(75.421, 26.845, 16.944)}
local tween1open = TweenService:Create(Ice, tweeningInformation, tween1)
local tween1close = TweenService:Create(Ice, tweeningInformation, tween2)

local function playTween()
	tween1open:Play()
	wait(1)
	tween1close:Play()
end

playTween()

Not sure if that’ll change anything but it’s worth a shot

1 Like

It worked! Glad that helped lol.