Help with tweening the Transform property of Motor6D in a local script

Hi all, I am struggling to tween the transform property of Motor6D. Even if everything in the code works, for some reason, the tween just does not play in workspace. I have no idea why, please help

This is the code that I put inside StarterPlayerScripts to test this, even though “Tweening” was printed, the tween did not play. I have tried to pause all running animation tracks as well as disabling the Animate local script before running this script again, it still did not work. Please let me know if any of you have any ideas

local TS = game:GetService("TweenService")
local PS = game:GetService("Players")
local UIS = game:GetService("UserInputService")

PS.LocalPlayer.CharacterAppearanceLoaded:Connect(function(Character)
        UIS.InputBegan:Connect(function(Input)
                if Input.KeyCode == Enum.KeyCode.Home then
                        local Tween = TS:Create(Character.HumanoidRootPart.RootJoint,TweenInfo.new(1),{["Transform"] = CFrame.new(1,2,3)})
                        Tween:Play()
                        print("Tweening")
                end
        end)
end)

I tested it out and the character function never triggers. Change out CharacterAppearanceLoaded with CharacterAdded, see if that helps.

I did as you said, and I also wrapped the print statement inside Tween.Completed

local TS = game:GetService("TweenService")
local PS = game:GetService("Players")
local UIS = game:GetService("UserInputService")

PS.LocalPlayer.CharacterAdded:Connect(function(Character)
        UIS.InputBegan:Connect(function(Input)
                if Input.KeyCode == Enum.KeyCode.Home then
                        local Tween = TS:Create(Character.HumanoidRootPart.RootJoint,TweenInfo.new(1),{["Transform"] = CFrame.new(1,2,3)})
                        Tween:Play()
                        Tween.Completed:Connect(function()
                                print("Tweening")
                        end)
                end
        end)
end)

The code indicated no errors whatsoever
image
But the tween still doesn’t play, like, I don’t physically see any change with the RootJoint

I was able to move the Character by modifying C0. In the tween, instead of Transform, type C0.

local Tween = TS:Create(Character.HumanoidRootPart.RootJoint,TweenInfo.new(1),{["C0"] = CFrame.new(1,2,3)})

guys how about you just animated it? it would be easier and less code

Hi all, I found the solution to my problem. All I needed to do was read the documentation more attentively


I just needed deleted the animator inside the Humanoid, and now it works

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.