Why does my tween not work?

what did you do to make yours work? i have a folder called “Technical” for scripted things. both eyes are there. i made 2 seperate scripts for each in a part called MTrigger (movetrigger). both eyes are small spheres. they are anchored. i want them to move down so i just put -5 on the Y axis. i am not sure why i gave you this info because it’s basically useless but i am pretty annoyed.

I just copy pasted the script into a part, put another part named Eyes1 in workspace then anchored it. Afterwards I just changed the Eyes variable in the script to define the part.

What if its because the parts you’re trying to tween are spheres?

it isn’t. it doesn’t work with a regular part.

Where is this script located? I tried making the script a child to the part that gets touched, and it did not work.

I moved the (local) script to StarterGui and then it worked, however the script was slightly modified:

print("script ran")
local ts = game:GetService("TweenService")

local Eye1 = game.Workspace.Technical:WaitForChild("Eye1")

local Eye2 = game.Workspace.Technical:WaitForChild("Eye2")

local Info = TweenInfo.new (0,

	Enum.EasingStyle.Linear,

	Enum.EasingDirection.Out

)

local Goal = {Position = Vector3.new(0, -5, 0)}

local Eye1Tween = ts:Create(Eye1, Info, Goal)

local Eye2Tween = ts:Create(Eye2, Info, Goal)

workspace.sensor.Touched:Connect(function(hit)
	if game.Players:FindFirstChild(hit.Parent.Name) then
		
		Eye1Tween:Play()
		Eye2Tween:Play()
		print("tweens played")

	end

end)

Also, if you want the eyes to move down from their current position, you should probably change the goal a little bit.

doesn’t work. i have no clue why.

Is the script a child to the sensor?

No, I’ve changed it to a local script and put it in startergui as you told me.

Are there any errors in the output?

Nope. Not at all. It’s really weird.

Weird. I have no clue what more to do to help you unfortunately.

I’ll screenshot my workspace, and maybe you can find the problem?

Sensor. Can Collide is off.
image

Eyes. Spheres, Anchored.

Localscript.
image

The script is the same one as I mentioned above. Also, try use some prints to figure out if the code is actually working.

I will modify the code block from earlier and add prints.

Unfortunately, do not know why exactly this is happening.

Here is the studio file where it works.
eyes.rbxl (260.8 KB)
(The script in there is altered slightly so you can see what is happening)

I’m pretty sure it didn’t print, also your setup is identical to mine except i named mine MoveTrigger.

Try moving in the setup from the file I sent into your main game.

I’ll try to download your file and run it, then test it in my game.

1 Like

DOESN’T WORK
image
image



image

I just created a quick copy of your setup with 3 parts (2 eyes and a sensor, shown below) and used the exact code you provided in your first post. Upon running, it all worked perfectly fine.

image

One thing I would like you to check is the position of your Eye1 and Eye2 parts. Please can send their positions here?

image
image

Are you using the script provided by @SilentKiller5557 or your original one?

the one provided by @SilentKiller5557

Could you show what you’ve currently got (with an image)