Tween not working(but should)

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I wanna achive my looped tween works
  2. What is the issue? Include screenshots / videos if possible!
    Idk why, but it just do nothing.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I looked on dev hub to write a tween and it’s must work.

Code:

local RoadObject = script.Parent
local TweenService = game:GetService("TweenService")
local TweenInfo1 = TweenInfo.new(
	4,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	-1,
	true,
	0
)

local tween = TweenService:Create(RoadObject,TweenInfo1, {Position = Vector3.new(-177.506, 2.4, 362.461)})

tween:Play()
1 Like

Are there any errors in the output? Is RoadObject already at the position specified by the tween (i.e. Vector3.new(-177.506, 2.4, 362.461))?

1)No. 2) It’s on -177.506, 1.4, 362.461

I can’t see anything changing position where to tween, still nothing.

I’m not sure why it isn’t working. The demo I’ve made here seems to work:
https://gyazo.com/f42caa2c4a985170271768c74cafb50c

What is RoadObject? Is it a Part or a Model (etc.)?

It’s part. Here screenshot

image
in game

Problem identified. :sunglasses:

You’re using a Local Script rather than a Server Script. Local Scripts only work when they’re in StarterPlayer > StarterPlayerScripts (as far as I know).

If you want the movement to be client-sided, you should move the Local Script to StarterPlayerScripts (I’m not sure if this is ideal for your case but it would fix the problem), otherwise you should change it to a Server Script and leave it where it is.

You are bit wrong. Local script could work from workspace. ScreenGui. StarterPlayerScripts. But amma try

Yeah it’s works from player scripts. But i managed to use a lot of local scripts in workspace.

Oops, I forgot about StarterGui :sweat_smile: (and StarterPack too, I guess?). I don’t think they work in the workspace, though.

I think it’s depends on code. Because i had a lot of local scripts in workspace.

Starter pack is for tools, not for scripts.

Like if i get GUI objects from workspace local script, everything fine.

The tools in StarterPack can have scripts though :wink:.

Anyway, did moving it to StarterPlayerScript solve the problem?

Like if i get GUI objects from workspace local script, everything fine.

I don’t think this is part of the problem anymore, but what do you mean by that (out of interest)?

Like if im changing position of gui object in playerGui it’s works.