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

How to change transparency of CFrames?

Asked by
tantec 305 Moderation Voter
5 years ago

I can't change the transparency of my CFrames, I have seen other people do it so sorry for my amateur attempt at this as I'm really struggling

local Baseplate = game.Workspace.Baseplate
while true do
    Baseplate.CFrame.Transparency = 0.1
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.2
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.3
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.4
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.5
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.6
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.7
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.8
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.9
    wait(0.1)
    Baseplate.CFrame.Transparency = 1
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.9
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.8
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.7
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.6
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.5
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.4
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.3
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.2
    wait(0.1)
    Baseplate.CFrame.Transparency = 0.1
    wait(0.1)
    Baseplate.CFrame.Transparency = 0
end
0
Setting a CFrame's transparency? CFrame doesn't have a 'Transparency' property hellmatic 1523 — 5y

3 answers

Log in to vote
0
Answered by
jaschutte 324 Moderation Voter
5 years ago

CFrame doesn't have a transparency. Bricks do. If you want to change the transparency of a brick, you can use this:

local part = workspace.Baseplate
local tweenLength  = 1 --how long the 'animation' will take
local info = TweenInfo.new(tweenLength) 
while game["Run Service"].Heartbeat:Wait() do
    game.TweenService:Create(part, info, {Transparency = 1}):Play()
    wait(tweenLength)
    game.TweenService:Create(part, info, {Transparency = 0}):Play()
    wait(tweenLength)
end
0
omg im talking about cframe transparency you not listen!!! tantec 305 — 5y
0
CFrame. Doesn't. Have. Transparency. I've clearly stated that. You're the one not listening. And if you don't want to use my code. That's fine with me, but don't go blame me for 'not listening' because you want something that doesn't exist. jaschutte 324 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

CFrame doesn't have a Transparency property. If you wanted to change the transparency of the baseplate you could just make a simple for loop.

local Baseplate = game.Workspace.Baseplate

--// Fade out loop
for i = 1, 10 do
    Baseplate.Transparency = i/10
    wait()
end
Log in to vote
0
Answered by
piRadians 297 Moderation Voter
5 years ago

Fact is: You cannot change a CFrame value.

TheCFrameproperty does not have a Transparency component, the proper way would be to create a for loop, and change the BRICK's Transparency property, which is valid in this case.

For example.

for i = 0,1,0.01 do -- The first number is the "start", second is "end", and third is the increment, or how much you're increasing/decreasing, in this case, increasing.
workspace.Baseplate.Transparency = i
wait(0.01)
end

This should gradually increase your baseplate's Transparency property.

Answer this question