Help me with tweenservice please, rotate/move with coroutine, 2 tweens at same time

  1. I want to tweenservice the rotation, and move time at the same exact time, but with different "TweenInfo.new(10) for example, so if I make the move 1 second, then TweenInfo.new(10) won’t rotate 360 degrees extremely fast, I wanna have different types of TweenInfo.new(numbers) all in 1 script, 1 line so I can rotate the mask through different types of areas in the script

  2. The tweenservice either doesn’t work if I coroutine it, or it doesn’t play at all… If I have it all in 1 line, like position, and cframe "TweenInfo.new(1) then if the rotation is 360, it’ll spin extremely fast, and not smooth at all.

  3. I’ve tried coroutine, I’ve tried playing it by just “Play()” it seems to work with size, and transparency with coroutine, but if I even try rotating and moving it won’t work

Code: (Normal Tweenservice) My original code… I got 2 scripts I’m trying to demonstrate, thank you.

--- Configurations

local TweenService = game:GetService("TweenService")
local rotationInfo = TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut, 0, false, 0)
local stageFunctions = script.Parent.Parent.Parent
local Face = stageFunctions.Face.Handle

while true do
	--Start of the loop of everything dark, and no flamethrowers, or lights

	wait(4) ---stays still for 25 seconds

	--End of start, of the loop of everything dark, and no flamethrowers, or lights


	--Function, Forward/back mask pop out, left, forward/back, right---------------------------------------------------------------------------------------------------------


	local movingFace = TweenService:Create(Face, rotationInfo, TweenInfo.new(10), { CFrame = Face.CFrame + Vector3.new(0, 0, 1)})
	movingFace:Play()
	local rotatingFace = TweenService:Create(Face, rotationInfo, TweenInfo.new(10), { CFrame = Face.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 0.9)}) ---rotates right
	rotatingFace:Play()


	--End of Function, Forward/back mask pop out, left, forward/back, right-----------------------------------------------------------------------------


	for _, part in ipairs(stageFunctions.StageLightPack.TowerLight:GetDescendants()) do
		if part:IsA("SpotLight") then part.Enabled = true end
	end
end```


Code: (V) "Coroutine"



```local TweenService = game:GetService("TweenService")
local Face = script.Parent
local rotationInfo = TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut, 0, false, 0)


local Tween1 = TweenService:Create(Face, rotationInfo, TweenInfo.new(10), { CFrame = Face.CFrame + Vector3.new(0, 0, 1)})
local Tween2 = TweenService:Create(Face, rotationInfo, TweenInfo.new(10), { CFrame = Face.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 0.9)}) 



coroutine.wrap(function()
	Tween1:Play()
end)()
Tween2:Play()

I accidentally put the 2 scripts in 1 script.

the other script is

local Face = script.Parent
local rotationInfo = TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut, 0, false, 0)


local Tween1 = TweenService:Create(Face, rotationInfo, TweenInfo.new(10), { CFrame = Face.CFrame + Vector3.new(0, 0, 1)})
local Tween2 = TweenService:Create(Face, rotationInfo, TweenInfo.new(10), { CFrame = Face.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 0.9)}) 



coroutine.wrap(function()
	Tween1:Play()
end)()
Tween2:Play()```

Tweens do not yield the current thread of execution unless you explicitly instruct them to do so via waiting for their ‘Completed’ event/signal to fire. They are instead handled by the task schedular.

Tween1:Play() --Both played at the same time.
Tween2:Play()
3 Likes

That doesn’t work I’ve tried that

‘That doesn’t work’ isn’t very descriptive, but I see now that you’re trying to tween the same instance’s property at the same time in two different tweens which of course will not work.

1 Like

Controninue.wrap() works like this

Tween1:Play()
coroutine.wrap(function()
Tween2:Play() 
end)()

I’ve tried that it works for only size, and transparency.

What? What do you mean by that could you be more clear?

I’ve tried coroutine like you’ve said for the size, and transparency it works… This is a “while true” but- for when I try to rotate, and move at the same time it doesn’t… I even tried orientation, and position, or sometimes if it works it moves from vector 1 for example and vector -1 it’ll move past the vectors I’ve chosen, like I’ve said I’ve given examples from the forum, on the top which my problem is on 2,3 the problem is I want these to rotate, and move at the same time with vector.new (0,0,1), (0,0,-1) to the same position regardless, and ofc rotating at the same time… I’ve tried everything, the problem is- read this carefully… If I put these all in 1 tween for example, and the tweeninfo.new(1), if I have it rotate 360 degrees it’ll rotate extremely fast… I don’t want that. I need it to move tweeninfo.new(1), and then rotate tweeninfo.new(10) for example, this is so the 360 degree won’t rotate extremely fast, and it’s a rotation speed and looks really smooth, please I hope you know how to fix this… I’ve been looking for resources for weeks.