Help with image tween

Hello developers!

Basically, I’m trying to create a tween (using TweenService:Create()) between two images and I thought it would be just like changing them normally, by that I mean simply changing the Image property from something like "rbxassetid://3944676352" to "rbxassetid://3944680095".

Which works, but if I try to tween the property, it outputs this error:

I’ve looked at the Content Data Types, but it says, I quote: On Roblox, content is a special formatted string that refers to an asset, such as an image, sound, or mesh.

Keyword: string.

Script snippet:

local tweenService = game:GetService("TweenService")
local dpButton = settingsFrame.DragPlace.DPButton
local checkImage = "rbxassetid://3944680095"
	
local imageTween = tweenService:Create(dpButton, TweenInfo.new(), {Image = checkImage})

imageTween:Play()

So what am I doing wrong? Is this possible?

2 Likes

That’s not possible. However, you can make 2 ImageLabels and set the transparency of the first one to 1 and the second one to 0 with TweenService.

I know, but I’m trying to get sort of a “drawing effect”, similar to the google checkboxes, where it gradually animates the checkmark in, is that possible?

If you mean tweening ImageIds, it is not possible.
Can send a gif of what youre trying achieve?

Something similar to this

checkbox

I know this is most likely impossible in rlua, but instead of gradually filling in the exact shape, I would be more than satisfied with a bottom - top animation.

Simply that it is cannot be on a string for tweening.

You could use a spritesheet to achieve that effect, much better. If this answer helps, please mark it as a solution so other community members can easily find this if they are going through the same problem.

A spritesheet is a basically a decal of multiple images, so to speak.

Check out these articles:

1 Like

Thanks, I didn’t know you could do that, I’ll make sure to use it in the future.