Tween doesn't work correctly

Hey everyone, I’m working on a simulator game and am trying to make a tween animation play every time I hit a part using a tool that I made.

The issue is whenever the tween plays, instead of increasing the size of the part a tiny bit, it makes it huge. Even if I change the script it does the same thing on a different axis or it makes the part really small.

I’ve tried looking for solutions but I haven’t seen anyone with the same problem as me.

Here’s a video of the problem
robloxapp-20211110-1726537.wmv (731.9 KB)

I’m trying to make the part get a little bigger then go back to it’s original size really quickly.

This is the script I was using:

local function damageTween(part, size, option)
	local Info = TweenInfo.new(
		0.5,
		Enum.EasingStyle.Bounce,
		Enum.EasingDirection.Out,
		0,
		false,
		0
	)
	
	local IncreaseGoals = {
		Size = Vector3.new(part.Position.X + size, part.Position.Y + size, part.Position.Z + size)
	}
	
	local DecreaseGoals = {
		Size = Vector3.new(part.Position.X - size, part.Position.Y - size, part.Position.Z - size)
	}
	
	local increaseTween = TweenService:Create(part, Info, IncreaseGoals)
	
	local decreaseTween = TweenService:Create(part, Info, DecreaseGoals)
	
	if option == 1 then
		increaseTween:Play()
	else
		decreaseTween:Play()
	end
end
damageTween(base, 1, 1)

I’ll send the whole script or anything else if this isn’t enough to solve the problem

Thank you

local IncreaseGoals = {
	Size = Part.Size + Vector3.new(size, size, size)
}

Try this one

2 Likes

That worked, thank you so much!

1 Like

Before you were attempting to add the individual components of a Vector3 value (which are number values) with a Vector3 value, you could have made it work by changing “size” to “size.x”, “size.Y” and “size.Z”.

1 Like