Need help with my tweenserivce script, it stops halfway.. I don't know what's causing it

  1. What do you want to achieve? Keep it simple and clear!

Alright, so as I was watching and following along the tweenservice from TheDevKing tutorial.
I want the BaseStar to do the same info on the variable (Goal). Such as increasing the Size of the part, changing the brickColor, setting the transparency to .5 and the Collision and kill a player when they come in contact with the part.

  1. What is the issue? Include screenshots / videos if possible!

it tweens all together smoothly but it stops halfway and doesn’t go all the way up. There is no errors…

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I tried doing some research on google and developer forum but couldn’t find a way to fix it.

I really hope someone could help me with this.

Thanks!

wait(5)

print("Starting TweenService!")

local Tween = game:GetService("TweenService")
local BaseStar = game.Workspace.BaseStar

local info = TweenInfo.new(
	10,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local Goals = {
	Size = Vector3.new(120, 98, 122);
	CanCollide = false;
	Color = Color3.new(1, 0, 0);
	Transparency = .5
}

local MakePartBigger = Tween:Create(BaseStar, info, Goals)

wait(1)
MakePartBigger:Play()

BaseStar.Touched:Connect(function(hit)
	local Humanoid = hit.Parent:FindFirstChild("Humanoid")
	if Humanoid then
		Humanoid.Health = 0
		print("Successfully killed a player..")
	end
end)

Try removing the CanCollide goal. I might be wrong (since bools are listed as tweenable in the API reference) but I don’t think it’s a property that can be tweened.

I tested it and I don’t see it stops halfway? (I don’t know what you’re trying to say here)

The only solution I can provide is to anchor it if you didn’t anchor it.

I forgot to include the video, watch this I want it to go all the way up but it stops tweening halfway.

Ah I get it now, well you also need to tween the position to the spawnlocation

local Goals = {
	Size = Vector3.new(120, 98, 122);
	CanCollide = false;
	Color = Color3.new(1, 0, 0);
	Transparency = .5
    Position = workspace.SpawnLocation.Position
}

Another way is to just double the size

Size = Vector3.new(120, 98, 122) * 2;

-- if doesn't work then try this
Size = Vector3.new(120*2, 98*2 , 122*2) 

YO, @Crictoli it w0rks tysm! :smile:

1 Like

Ay no problem, make sure to mark as solution so everyone knows this post has a solution.

I watched TheDevKing tutorial and it was my first time learning how to tween from him and like I feel lost when the star doesn’t tween all the way.

anyways thanks @Crictoli really do appreciate the solution :slight_smile:

1 Like

hey, @Crictoli I have another problem. I made a new tweenservice script I am trying to mess around with the code and practice with it. But it doesn’t tween when I run the game nor does it output any errors… can you help me?

local TWS = game:GetService("TweenService")
local TweenPart = game.Workspace.TweenPart

local mation = TweenInfo.new(
	1.5,
	Enum.EasingStyle.Elastic,
	Enum.EasingDirection.Out,
	0,
	true,
	0
)

local PropertiesGoal = {
	Size = Vector3.new(120*2, 98*2 , 122*2);
	Color = Color3.new(0.333333, 1, 0);
	Transparency = .5;
	Position = workspace.Gb.Position
}

local Bigger = TWS:Create(TweenPart, mation, PropertiesGoal)

wait(1.5)
Bigger:Play()

Try removing the value of the PropertiesGoal one by one and see if it tweens, also try printing before the wait and after the play function.

I’m on mobile so I can’t directly help right now.

I see what’s causing the problem it was because of the Position = workspace.Gb.Position I removed it now it tweens.

btw, how do I print the size in the ouput when is increasing, is it possible to do that?

yes print(script.parent.size)
it should print the size of the object.

add into the tween Local Istweening = true
while Istweening do
print(script.parent.size)
end

when the tween is done do Istweening = false