I have this script here and I wanna know why the part flies away! Ive tried replacing with waitforchild() but that didnt work. Im trying to make a random meter that varies in value.

--Services
local TS = game:GetService("TweenService")
local RS = game:GetService("RunService")
local HS = game:GetService("HttpService")

--Definers
local part = script.Parent.SpawnTherm:WaitForChild("Moving")


while wait(4) do
	--Defining Tables and Table Editing
	local mathRandom = math.random(2.5, 4)
	local goal = Vector3.new(0.7, mathRandom, 0.05)
	local tweenInfo = TweenInfo.new(
		4,
		Enum.EasingStyle.Cubic,
		Enum.EasingDirection.Out,
		0,
		false,
		0
	)


	while wait(1) do
		part.Position = Vector3.new(part.Position.X, part.Position.Y, part.Position.X)
		wait(0.05)
	end

	local Tween = TS:Create(part, tweenInfo, {Size = goal})
	Tween:Play()
end

8 comments

0

So are you trying to make the part move? Because you dont have to do that with tweening.

0

@MarcTheRbuxQb im trying to make an offset so it doesnt go inside of the block above it

0

is can collide on?

0

no, can collide is off. its also anorched.

0

well if can collide is off then it goes through things

0

turned it on and its still causing problems, please help!

0

is the part above can collide off?

0

both gotta be can collide on