Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tweening to a part's position/size just ends up tweening to origin and sizing to 0.05, 0.05, 0.05?

Asked by 3 years ago

So I'm making an animation system via tween for a bus and I wanna perform 2 tweens, an initial tween moving the doors away from the body and a second tween moving them to the side. I can't just tween to where I want, I need to tween to a part's position, so I grabbed this script to make sure it works.

local TS = game:GetService("TweenService")
local tweeningInformation = TweenInfo.new(
--Tween Properties.
5, -- Length
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0, 
false,
.1
)

local partProperties = {
    Size = Vector3.new(script.Parent.Parent.pos.Size);
    Position = Vector3.new(script.Parent.Parent.pos.Position);
}

local Tween = TS:Create(script.Parent,tweeningInformation,partProperties)

script.Parent.ClickDetector.MouseClick:Connect(function()
    Tween:Play()
end)

GIF linked is what happens when I click the part. https://gyazo.com/0cc9f60d8f2801aa10535d38938c89df

1 answer

Log in to vote
1
Answered by 3 years ago

Hmm...... I don't really see the problem with the code. You can try to add this

Tween:Cancel()

But i don't know if that will work.

You can also try to rearrange the info similar to the devForum.

local goal = {}
goal.Position = Vector3.new(10, 10, 0) -- obviously replace with what you need
goal.Color = Color3.new(0, 1, 0) -- except it would be size for you

you might just wanna get a rig builder plugin and make joints. That normally works and i find it a lot easier than tweenservice. I use RigEditPlus by Arch_Mage and i highly recommend that.

After you make the joints, move the joints to the right position, then animate using a plugin or even the defaut anim editor.

I hope this helps. till next time

Ad

Answer this question