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

Scrolling Frame help?

Ok, So I am trying to set the position of a scrolling frame and it dosen't work, This is the output I am getting:

SurfaceGui.One.Res:4: bad argument #3 to 'CanvasPosition' (Vector2 expected, got string)

So I thought, Should I add a Vector2 to the statement?

But how?

Help pls

( ° ?? ?°)

1 answer

✓ Accepted answer

As it is telling you, the CanvasPosition propety is a Vector2

You gave it (it "got") a string. So wherever you had your string, you're going to replace that with the new Vector2.

Something like this:

-- With string, INCORRECT
frame.CanvasPosition = "(50, 100)"

should look like this:

frame.CanvasPosition = Vector2.new( 50 , 100 )
-- 50 is x, 100 is y, in pixels

5 comments

0

Thanks!

0

script.Parent.Changed:connect(function() sound.Pitch = canvasPosition.Y / 255 end)

0

Whoops, Is it possible to get the canvas position without using Vector (not change it)

0

Whoops, Is it possible to get the canvas position without using Vector (not change it)

0

What you have stated will work. I don't understand what your question is.

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