So what the bottom code does so far is, it tweens both the rotation and position of a primary part that I have hooked up to a model.
It works fine, although I’ve noticed a huge issue, it seems every single time the rotation tween plays, it gets faster and faster, it starts off slow and after each loop, it just goes really fast until at one point causes lag and bugs out.
I feel like the issue lies inside
local rotation = {
Rotation = primary.Rotation + Vector3.new(0,90,0)
}
but I’m not sure what I should use instead of adding a new Vector3 each time.
Keep in mind I’m also using a primary part so CFrames would be an option I just have no idea how I would implement it
local originalrotation = primary.Rotation
local rotation = {
Rotation = primary.Rotation + Vector3.new(0,90,0)
}
local info = TweenInfo.new(
--time, easingstyle repeatcount(negative number loops indefinitely), reverses(true/false), delay
100,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
-1,
true
)
local position = {
CFrame = primary.CFrame + Vector3.new(0,0,20)
}
local info2 = TweenInfo.new(
--time, easingstyle repeatcount(negative number loops indefinitely), reverses(true/false), delay
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
-1,
true
)
local partTween = TweenService:Create(primary, info, rotation)
local partTween2 = TweenService:Create(primary, info2, position)
partTween:Play()
partTween2:Play()
Maybe you can destroy the tween value, then recreate it. Like after it plays you can do partTween:Destroy, and then maybe add a script to re create it? Sorry I’m not too advanced with tween.
No there are no errors, I guess the reasoning for this is because playing two tweens can override each other, and since i’m changing the Cframes rotation and position, it seems to only be changing the primary parts position and ignoring the rotation
I played the tween in a brand new file and nothing seemed to go wrong, or at least, nothing was getting faster. If possible could you send me your whole script?
Yeah unfortunately it still speeds up, maybe it’s just some flaw on my end, although it works the same. Thank you anyway, I’ll just go with this for now maybe in the future I can figure something out