Script for atmosphere tweening is probably in wrong syntax

I have this script for randomly tweening the atmosphere’s haze property. It doesn’t work, and I think it has something to do with a syntax error.

local TweenService = game:GetService("TweenService") 
local Pos = Vector3.new(10) -- Change this to the position you want part to move to

local Moving_Info = TweenInfo.new(
10,-- the amount of seconds you want it to take
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
9999, --The amount of time you want it to repeat
true, --Whether you want it to reverse back to the original position when it's done
0 -- how much time should delay between each repitition
)

TweenService:Create(Part, Moving_Info, {Position = Pos}):Play()

I am assuming this is the full code. And if so, you never defined a Part variable.

And it should be throwing this error too:
image

1 Like

left out a line, sorry
local Part = game.Lighting.Atmosphere -- Change this to your part

(post deleted by author) ᅟ ᅟ ᅟ

You’re trying to interpolate the Position property of a Atmosphere.

image

You might be looking for Offset?

I’m trying to tween the haze property.

You would want to change this to {Haze = newHaze} then define a newHaze variable with a specified Haze represented by a number.

Pseudo-code:

local newHaze = 10

TweenService:Create(..., {Haze = newHaze}):Play()
1 Like