my game is a single player horror game. this is a regular script. also i am not using otherpart or ontouch type of stuff because this is what i am more comfortable with and it works fine.
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 Tween = ts:Create(Eye1, Eye2, Info, Goal)
script.Parent.Touched:Connect(function(hit)
if game.Players:FindFirstChild(hit.Parent.Name) then
Tween:Play()
end
end)
Upon pasting your code in studio, it appears that you weren’t using speech marks? And that you forgot to close a bracket for the TweenInfo. Did you check the output when it didn’t work?
local ts = game:GetService("TweenService")
local Eyes1 = game.Workspace.Technical:WaitForChild("Eyes1")
local Info = TweenInfo.new (0,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out
)
local Goal = {Position = Vector3.new(0, -5, 0)}
local Tween = ts:Create(Eyes1, Info, Goal)
script.Parent.Touched:Connect(function(hit)
if game.Players:FindFirstChild(hit.Parent.Name) then
Tween:Play()
end
end)
I suggest not separating your code one empty line apart, it makes it harder to read. Also, you didn’t have to do the “0, false, 0” in the TweenInfo since that’s already set by default. And next time, do send your code in a code block. Do this by using the key under the esc key like this:
Is there a WaitForChild yield in the output? Perhaps Eyes1 isn’t found. If not, is the part you’re trying to tween not in the place it finishes tweening at?
No, that’s basically the same thing. Could you play your game, touch the part, then show me a screenshot of the output so I can see if there’s any errors.
Why are you putting Eye2 as the second param of ts:Create()? It should be the tween info otherwise it would error, no?
Just create another tween for Eye2 and play that aswell