Moving Objects Smoothly (Tweening)

Hello, I am currently trying to use Local Script with tweening but it does not work, I tried to move a part towards the player via local script but it only activates on the LocalPlayer, what is happening?
Here is my code:
local tweenService = game:GetService(“TweenService”)
local HumanoidRootPart = script.Parent

while wait() do
    local goal = {}
    goal.CFrame = script.Parent.Parent.Parent.HumanoidRootPart.CFrame * CFrame.new(-3*(1-script.Parent.Parent:WaitForChild('Torso').Transparency), 1*(1-script.Parent.Parent:WaitForChild('Torso').Transparency), 2*(1-script.Parent.Parent:WaitForChild('Torso').Transparency))
    local tweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
    local tween = tweenService:Create(HumanoidRootPart,tweenInfo,goal)
    print(tween)
    tween:Play()
end

here is my thing
image
Thank you.

It will be helpful if we know where the local script is located.
Just incase it is located in the workspace or the Storages etc it won’t work.

1 Like

I see, is there a way to run it on the ServerScriptService efficiently?

Nope local scripts will not run on “server script service” this place if for storing modules and server scripts.
You can place them in “Starter GUI” or “starter character scripts” and etc.
I suggest you go over this API reference which explains local scripts and all its uses well and more:
LocalScript (roblox.com)
I kind of understand from the title but for one time can you specify what you are trying to do with the dummy and what the clients should be seeing.

Local scripts run exclusively on the client. Try to do a server implementation of this instead.

What the clients should be seeing is the dummy behind the character of everyone (like pets in clicker games), I also went over the API reference of the LocalScript and it helped me understand how LocalScript works more, thank you.

In that case I suggest doing everything from the server after picking up a certain call from the client.
so if you want to give every player a own dummy who follows the player’s character after the character is added then try this:


If you don’t understand something in the script above reply because I don’t want to spoon feed code instead explain what each line of code is doing and how it has an impact.
Note: Though this will work but remember nothing here is relative to physics and if you want it then I suggest using Body Positions and also Body Gyro for rotation
Here are the Api references on how they play their role and how to use them:
BodyPosition (roblox.com)
BodyGyro (roblox.com)