Need help in Making an Image Carousel in Roblox Studio(Not a image slideshow)

  1. I want to make a image carousel like a website.(Not a image slideshow)

Screenshot:

  1. I want to make a image carousel like a website.(Not a image slideshow) but I can’t figure out how to script it. Include screenshots / videos if possible!

  2. I have no solution in mind for how to do it. I cant figure out what script to use. And yes I have searched the Developer Hub.

Extra details: So basically I am working on a game which tells you about all cars in the world. And I am stuck on making an image carousel which shows the images of the car. (You need to press a button to see the next image) (Need to press a button to see previous image)

1 Like

You could make a function that takes a takes a table of images then positions them with offset based on position in the table

so

for i, v in pairs(table) do
   v.Position = Udim2.new(v.Size.ScaleX * #table - i, 0, 0, 0) 
--dont quote me on that equation but something along those lines should do
end

and
-put all of those in a frame
-make sure clip descendants is off
-have scale of all images (1,0,1,0)
and then tween the frame accordingly to however many images you have, so if you have 10 then set a limit on next tween to 10 and subtract accordingly etc.

OR

you could also make the tween infinite, i haven’t a clue currently how to do it efficiently but I’m sure if you dig around you’ll find a solution somewhere

1 Like

I understood the script part… but what tween to use, like in and out or slide or what. I have 5 images.
Edit: also what do you have to do in the script where it is saying

v.Position = Udim2.new(v.Size.ScaleX * #table - i, 0, 0, 0)

like what numbers do I have to write after the i

so the frame is the parent of the images, so you tween the frame. and with everytime you tween(tween being player pressing the arrows for next/previous image) you can make a counter so that way when the player presses next is takes one away and when the player presses previous it adds one, but the limit constraint would be between 5 and 0 since you only have 5 images

it would work like
Next = -1
Previous = +1
A bit hard to word, but hopefully you get the idea. This is also going based off your reference image.

1 Like

I am using the .Visible variable, should I use this instead of that? and I think you mean to make all images visible and change their transparency right?
Edit: Also sorry for the inconvenience… I am not used to such advanced scripts.

We both seem to be confused, visibility has nothing to do with tweening in this sense.
When i say tween i mean as in current image moves to the left and the offscreen image moves in from the right. If you didn’t want that result then i apologize. however what your talking about is a fading in and fading out transparency component, which is acceptable but not what you asked for.

Your question is a bit of an oxymoron. You asked for an image carousel, which is a type of slide show but you don’t want a slide show. I think you’re going to have to be a bit more specific.

1 Like

Ok, I think I figured it out… I am gonna try it in Studio and inform you if it works or not.

I did as you said… But it does not work
here is the script I used

for i, v in pairs(table) do
	v.Position = UDim2.new(v.Size.ScaleX * #table - i, 5 , 0, 5) 
	Next = -1
	Previous = +1
end

Again… Sorry for annoying you but I am not an advanced scripter.

i can’t code an entire script for you. I apologize if you were expecting more. Maybe brush up on coding/scripting before taking on such an ambitious project. glhf

1 Like

Just use a UiPageLayout object… Add some buttons that do this: Next and this Previous

2 Likes

You mean to use UIPageLayout but for images right?