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 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
But the tween still doesn’t play, like, I don’t physically see any change with the RootJoint