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

I'm trying to tween a TextureID (Decal) but I think I'm doing something wrong?

Asked by 2 years ago

I have this code:

local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(

    1,
    Enum.EasingStyle.Circular,
    Enum.EasingDirection.InOut,
    0,
    false,
    0

)
local PropertyTable = {

    TextureID = "http://www.roblox.com/asset/?id=7024453674"

}
local Tween = TweenService:Create(script.Parent,Info,PropertyTable)
wait(5) --For demonstration, I'm waiting for the game to load
Tween:Play()

But my output returns this error:

TweenService:Create property named 'TextureID' cannot be tweened due to type mismatch (property is a 'Content', but given type is 'string')

1 answer

Log in to vote
1
Answered by
Rinpix 639 Moderation Voter
2 years ago

If you take a look at the API reference, you'll see that you can't tween something that isn't a numeric value. You're trying to tween a string, which is why you're receiving an error.

If what you're trying to do is create a smooth transition between two images, you can just place the second one in the same place as the first with an initial transparency of 1, and then tween the transparency to 0, and the original image's transparency to 1, so that the first one fades out in the same time that the second one fades in.

1
Thanks! wwwaylon09 113 — 2y
Ad

Answer this question