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

[CLOSED] How should I use Vector2 in this situation?

Starting off, I am not sure if I should use Vector2 or not, I am open to other ideas, please note that.

I am playing around with GUIs, seeing if I could make the GUI move by what key I press. Here is my code:

local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(InputObject, Processed)
	if InputObject.KeyCode == Enum.KeyCode.A then
		script.Parent.Position = script.Parent.Position - Vector2.new(.5,0,0,0)
	end
end)

Error on line 4, Players.JailBreaker_13.PlayerGui.ScreenGui.Frame.Frame.LocalScript:4: invalid argument #2 (UDim2 expected, got Vector2)

I have never used UDim2, is Vector2 and option, if not, how do I use UDim2?

1 comment

0

Just use Udim2.new() its realy easy

1 answer

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