Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[Help plz] recreating flappy bird, UDIM2.new not working?

so im attempting to recreate flappy bird in roblox as "flappy block." so the first thing i wanted to do was make the character go down automatically. problem is that udim2 is NOT working with me.

i tried

spawn(function()
repeat 
wait(0.1)
script.Parent.Screen.Player.TextLabel.Position = UDim2.new(0.45, 0,(script.Parent.Screen.Player.TextLabel.Position.Y - 0.02), 0)


if script.Parent.Screen.Player.TextLabel.Position.Y < 0.86 then
print("dead")
break
end

until not playing

end)

but in the line attempting to make the character go down, it fails with this error. "14:27:19.119 - Workspace.Flappy Block.Play:18: bad argument #2 to '?' (UDim expected, got number)"

can somebody help?

1 answer

FIXED! needed to do Position.Y.Scale

script.Parent.Screen.Player.TextLabel.Position = UDim2.new(0.45, 0,(script.Parent.Screen.Player.TextLabel.Position.Y.Scale + 0.05), 0)

This discussion is preserved as it was. New answers, comments, and votes are closed.