My custom tweener can handle multiple tweens at once. leading to very complicated motion easily.
The only problem is that it can not tween angles more than 90 degrees in the x direction, as the orientation flips and starts going down.
This means my tweener can not say, tween to 180,0,0 in orientation, it would need to wait for it to get to 90, set it to 89,180,180, and then count downwards back to 0,180,180. This is very annoying.
Tween service does work, but annoyingly cancels the custom tweener until the tween is finished. That should be fine, but annoying.
local RS=game:GetService("RunService")
local TS=game:GetService("TweenService")
local sin=math.sin
local cose=math.cos
local rad=math.rad
local Linear=function(x) return (x/90)end
local Sine=function(x) return (sin(rad(x)))end
local Cosine=function(x) return(-cose(rad(x))+1)end
local Lerper=function(Plate,Goal,Time,method,product)
coroutine.resume(coroutine.create(function()
local alpha=0
local Connection
local PreviousCFrame=Plate.Position
local lastCF=Vector3.new(0,0,0)
while true do
local Newalpha = alpha + math.min(1.5 / math.max(Time, 0), 90)
alpha = (Newalpha > 90 and 90 or Newalpha)
local nextpos=Vector3.new():Lerp((Goal),method(alpha))
Plate[product]=nextpos+(Plate[product]-lastCF)
lastCF=nextpos
if alpha == 90 then print("end")break end
RS.Heartbeat:Wait()
end
end))
end
local part=game.Workspace.Part
wait(1)
Lerper(part,Vector3.new(8,0,0),2,Sine,"Size")
Lerper(part,Vector3.new(-8,0,0),2,Cosine,"Size")
Lerper(part,Vector3.new(0,0,10),2,Linear,"Size")
Lerper(part,Vector3.new(0,0,-10),2,Cosine,"Size")
Lerper(part,Vector3.new(0,10,0),2,Sine,"Position")
Lerper(part,Vector3.new(0,0,10),2,Cosine,"Position")
Lerper(part,Vector3.new(0,180,0),2,Linear,"Orientation")
I am simply asking if anyone has experience in this sort of thing, And if they can give me information and tips.