Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Scrolling Frame help?

Asked by
NotSoNorm 777 Moderation Voter
9 years ago

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

Log in to vote
3
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

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
0
Thanks! NotSoNorm 777 — 9y
0
script.Parent.Changed:connect(function() sound.Pitch = canvasPosition.Y / 255 end) NotSoNorm 777 — 9y
0
Whoops, Is it possible to get the canvas position without using Vector (not change it) NotSoNorm 777 — 9y
0
Whoops, Is it possible to get the canvas position without using Vector (not change it) NotSoNorm 777 — 9y
0
What you have stated will work. I don't understand what your question is. BlueTaslem 18071 — 9y
Ad

Answer this question