Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

why is tween is only partially working?

I want my tween to change transparency( this works) and have Cancollide = false (players will fall through, not working)

local TweenService = game:GetService("TweenService")
local part = script.Parent

local Info = TweenInfo.new(
	3, --length
	Enum.EasingStyle.Sine, --easingStyle
	Enum.EasingDirection.Out, --easing direction
	9999999,     --repeat
	true, --reverse
	0 --delay
)

local Goals = 
{
	
	--Anchored = false;
	Transparency = 1;
	CanCollide = false;
}
local makePartChangeTween = TweenService:Create(part, Info, Goals)


makePartChangeTween:Play()

I am making a part be "fallthrough" after the transparency is 1, my goal is to have a part that is either activated when player touches it, or it will continually activate.

2 comments

0

wait a so all you are doing with this tween is simply changing the parts transparency?

0

I would not use a tween for what you are trying to accomplish. I would simply put in a touched event and then initiate what ever the code you want.

2 answers

take cancollide out, after playing the tween put: makePartChangeTween.Complete:Connect(function() part.Transparency = 1 end)

3 comments

0

correct idea, wrong property. instead of makePartChangeTween.Complete:Connect(function() part.Transparency = 1 end) do makePartChangeTween.Complete:Connect(function() part.CanCollide = false end)

0

I need the CanCollide tho, or some other way to do the same thing

0

I need it to have some way for a player to fall off, ik it works with just the transparency. But that's not all I want.

If you want the player to fall off why not just do this:

script.parent:Connect(function()
	local part = script.parent
	part.CanCollide = false
	part.Transparency = 1
end)

I hope this helps and meets your needs. Hope I could help

This discussion is preserved as it was. New answers, comments, and votes are closed.