Having a Tween problem

Hello, i have an problem which is about “tweeninfo.new()”. It can be any kind of tween when i try to set a duration like “tweeninfo.new(5)”, even if tween have a time it doesn’t finish at the time instead of it, it finishes before time. I will reply tomorrow. Sorry.

1 Like

Can I see the code your using? It’s possible that it could be using the default value of 1 if the first argument is empty.

2 Likes

try this

local tw = game:getService("TweenServices")

local Background = script.parent.frame

tw:Create(Background,TweenInfo.new("seconds here"), {BackgroundTransparency = 0}):Play()

remember that if you want to do everything in 1 single line it is important to add the “{}”

1 Like

It can be any kind of tween of your using you can try anything. So i dont have any script about it because it happens everytime i use. And i was having this bug when i download the new update. And meanwhile when i shiftlock or go firstperson my cursor can be able to move, even if i force it tho. I dont think it is about me because before this update i were’nt having this issue. Before i forget to say,i just tried on different roblox places. It was happening every time to me

I tried it but it says: TweenInfo.new first argument expects a number for time.

assuming you’re trying to tween GUI but pointing to TweenInfo here.

TweenInfo is not used to create tweens, it’s expected to be the info for the tween so it’s recommended to create TweenInfo first without adding it inside TweenService:Create().

local TweenService = game:GetService("TweenService")
local frame = --link your frame here e.g script.Parent
local TInfo = TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)

TweenService:Create(frame, TInfo, {-- Custom properties here}

Time duration should come first, EasingStyle and EasingDirection is optional so you can delete it, keep or edit it.

1 Like

I was tried on part the transparency attribute, i was trying to tween. For example: You just made a tween script and transperency goes to 0.8. It must be 0.8 transperency in 5 seconds because you set tweeninfo.new(5). But it doesn’t work for me it just goes to 0.8 transparency in heartbeat speed maybe ?

I think it is about studio, but im not sure yet. And i just wrote everything right. Time was coming first.

Is it on a loop? (CharacterLim)

1 Like

What do you mean? So if you asking me the tween then i will say its not

You can pass the script as you wrote it and in which script mode you put it either script or localscript

Both, it doesnt matter. It doesnt work even if i try on local script or script.

I will try again,im definitively sure its about roblox studio not me. Now i gonna try it again.

I just tried after all and i closed every single plugin and other things can be problem to it. But still it doesnt work so if you want example:

local Tween = game:GetService("TweenService")

 local TweenCreate = TW:Create(script.Parent,TweenInfo.new(5),{Transparency = 0.5})
 
TweenCreate:Play()

im just creating one script into part and writing the same script. Transparency must be 0.5 in 5 seconds
but when i join the game Attribute is changing to 0.5 transparency quickly. It must be in 5 seconds but it doesnt wait 5 seconds.

Edit: I just tried something like set the time to other numbers it works but it isnt works in seconds when i set 15 its like 3 or maybe 7 seconds. didnt understand

you defined the tween as Tween and you put TW, that’s why it doesn’t recognize it, it should be something like this

local Tween = game:GetService("TweenService")

 local TweenCreate = Tween:Create(script.Parent,TweenInfo.new(5),{Transparency = 0.5})
 
TweenCreate:Play()
1 Like

Oh sorry i just tried with different things so i was trying to define it as a tween. everything was TW before. Be sure im tried

1 Like

If you want a script example, i just encountered with this problem when i was doing those script:

--THIS IS IN STARTERGUI

local Camera = game.Workspace.CurrentCamera
local Player = game:GetService("Players").LocalPlayer
local Hum = Player.Character:WaitForChild("Humanoid")

local Gui = script.Parent

local Mouse = Player:GetMouse()
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local TW = game:GetService("TweenService")

local function doTween(degrees)
	local tween = TW:Create(Camera, TweenInfo.new(5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out), {CFrame = Camera.CFrame:Lerp(Camera.CFrame * CFrame.Angles(0, 0, math.tan(degrees)),0.5)})
	tween:Play()
	tween.Completed:Wait()
    tween:Destroy()
end

function Inputend(input,gpe)
	if gpe then return end
	if input.KeyCode == Enum.KeyCode.LeftControl then
		Gui.Modal = not Gui.Modal
	end

end

RunService.RenderStepped:Connect(function()
	if UIS:IsKeyDown(Enum.KeyCode.A) and UIS:IsKeyDown(Enum.KeyCode.D) then
		doTween(0)
	elseif UIS:IsKeyDown(Enum.KeyCode.A) then
		doTween(80)
	elseif UIS:IsKeyDown(Enum.KeyCode.D) then
		doTween(-80)
	else
		doTween(0)
	end
end)

UIS.InputEnded:Connect(Inputend)

i just tried roblox’s tween script i mean i just went to website of tween and got the script but it worked when i do that. But when i write the same script it is not working maybe im doing wrong something ?

I tried on couple of baseplates some of it worked some of it did’nt. Thanks for helping to all. Overall i just fixed probably. If this happens again i will open thread on roblox studio bugs. Thanks again :pray: