I have humanoid models that I want to sort of run off the screen very quickly. I was planning on having the model turn sharply, then over a longer period of time (and with a different easing style) move away in the direction they turned to. However, since you can’t tween the CFrame of a model twice at the same time, this is impossible for me as far as I’m concerned.
local avatars = Workspace.Avatars:GetChildren()
for i = 1, #avatars do
if avatars[i] ~= highlightedAvatar then
local scramPos = Vector3.new((math.random(0,1)*400)-200, 3, math.floor(((avatars[i].Id.Value-1)/5))*15+math.random(-100,100))
local scramRotate = CFrame.lookAt(avatars[i].PrimaryPart.CFrame.Position, scramPos)
local hum = avatars[i]:WaitForChild("Humanoid")
local track = hum:LoadAnimation(avatars[i].Animate.run.RunAnim)
track.Priority = Enum.AnimationPriority.Action4
track:Play()
local tween = TweenService:Create(avatars[i].PrimaryPart, TweenInfo.new(scramTime, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {CFrame = CFrame.new(scramPos)*scramRotate})
tween:Play()
end
end
This is my current solution but the issue is that the tween is so long that the rotation barely completes before the model is completely off the screen. I tried using two separate tweens but only one would actually play.
Is there any way I can get around this?