No errors, everything works, successful prints

Hi, I’m trying to get these papers to float, though, only some will float. It changes which float and which do not every time. Another minor issue, they all move for the same time, even though it’s meant to be randomized.

Here's the code
-- Float
for i,Paper in pairs(game.Workspace.DoodleSphereMap.Portals:GetChildren()) do
	-- Variables
	local TweenTime = math.random(0.7,1.7)
	-- Main Paper Tween
	game:GetService("TweenService"):Create(Paper,TweenInfo.new(
	TweenTime,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	9999999999,
	true,
	0
	),{
		CFrame = Paper.CFrame - Vector3.new (0, 0.5, 0)
	}):Play()
	-- Paper Icon Tween
	game:GetService("TweenService"):Create(Paper.Icon,TweenInfo.new(
	TweenTime,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	9999999999,
	true,
	0
	),{
		CFrame = Paper.Icon.CFrame - Vector3.new (0, 0.5, 0)
	}):Play()
	print(Paper.Name .. " succesfully started floating.")
end
Here's an image of the Output bar

Video of the issue

Issue with Game Hub revamp - YouTube

math.random() in this case only returns integers. Try doing

local TweenTime = math.random(7, 17)/10

You should also look into the Random Library.
The equvalient of that code is :

local RandomObject = Random.new()

for i, Paper ....... -- finish this line
   local TweemTime = RandomObject:NextInteger(7, 17)/10
1 Like