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

How do i tween a models rotation?

Asked by 6 years ago

Hello, so i am in need of a model tween. I do not understand how to do this and I looked like EVERYWHERE for a solution but i dont find any.

Please help me, this is the script.

local brick = game.workspace.ON.Center
    function OnClick(Player)
local tween = function(itemtotween,property,value,tweentime,easingstyle,easingdirection)
    local info = TweenInfo.new(
        tweentime,
        Enum.EasingStyle[easingstyle],
        Enum.EasingDirection[easingdirection],
        0,
        false,
        0
    )
    local goal = {}
    goal[property] = value
    return game:GetService("TweenService"):Create(itemtotween,info,goal)
end
tween(brick,"Rotation",Vector3.new(-90, 0, 0),2,"Quad","InOut"):Play()
end
script.Parent.ClickDetector.MouseClick:connect(OnClick)

Basicly the "Center" is the part that i tween and want other parts to follow. I tried with primarypartcframe and everything but i dont seem to fix a way to set it up with this tween script.

Thank you for the help.

0
You cannot currently tween models since the CFrame can only be set with the function SetPrimaryPartCFrame. You can look at lerp which is a function of a CFrame which will do a similar thing. User#5423 17 — 6y
0
You cant tween models. To try tweening it, i recomend you to make it a '' union ''. xDestinoYT 2 — 6y
0
just a suggestion, tween every single part and figure out their relative CFrame with complicated math, tweening everything with a for loop fanofpixels 718 — 6y

Answer this question